container problem

hi :slight_smile:

I have a form and inside it a container where i have to attach a grid.

I have imported this js file:

[code]

<script src="js/dhtmlx/menu/dhtmlxmenu.js"></script>
<link rel="stylesheet" type="text/css" href="js/dhtmlx/menu/skins/dhtmlxmenu_dhx_blue.css">
<script src="js/dhtmlx/toolbar/dhtmlxtoolbar.js"></script>
<link rel="stylesheet" type="text/css" href="js/dhtmlx/toolbar/skins/dhtmlxtoolbar_dhx_blue.css">
	<link rel="stylesheet" type="text/css" href="js/dhtmlx/layout/dhtmlxlayout.css">
    <link rel="stylesheet" type="text/css" href="js/dhtmlx/layout/skins/dhtmlxlayout_dhx_blue.css">
    <script src="js/dhtmlx/layout/dhtmlxcommon.js"></script>
    <script src="js/dhtmlx/layout/dhtmlxcontainer.js"></script>
    <script src="js/dhtmlx/layout/dhtmlxlayout.js"></script>
<link rel="stylesheet" type="text/css" href="js/dhtmlx/form/skins/dhtmlxform_dhx_skyblue.css">
<script src="js/dhtmlx/form/dhtmlxform.js"></script>
<script src="js/dhtmlx/form/ext/dhtmlxform_item_container.js"></script>
<script src="js/dhtmlx/form/ext/dhtmlxform_item_combo.js"></script>
<script src="js/dhtmlx/form/ext/dhtmlxform_item_calendar.js"></script>
<script src="js/dhtmlx/form/ext/swfobject.js"></script>
<script src="js/dhtmlx/form/ext/dhtmlxform_item_upload.js"></script>
<script src="js/dhtmlx/form/ext/dhtmlxform_item_editor.js"></script>
<script src="js/dhtmlx/form/ext/dhtmlxform_item_colorpicker.js"></script>
<script src="js/dhtmlx/form/ext/dhtmlxform_item_btn2state.js"></script>
<script src="js/dhtmlx/form/ext/dhtmlxform_hide_on_disable.js"></script>
<script src="js/dhtmlx/accordion/dhtmlxaccordion.js"></script>
<link rel="stylesheet" type="text/css" href="js/dhtmlx/accordion/skins/dhtmlxaccordion_dhx_blue.css">
<link rel="stylesheet" type="text/css" href="js/dhtmlx/tabbar/dhtmlxtabbar.css">
<script  src="js/dhtmlx/tabbar/dhtmlxtabbar.js"></script>
<script  src="js/dhtmlx/tabbar/dhtmlxtabbar_start.js"></script>
<link rel="stylesheet" type="text/css" href="js/dhtmlx/windows/dhtmlxwindows.css">
<link rel="stylesheet" type="text/css" href="js/dhtmlx/windows/skins/dhtmlxwindows_dhx_skyblue.css">
<script src="js/dhtmlx/windows/dhtmlxwindows.js"></script>
<script src="js/dhtmlx/windows/dhtmlxcontainer.js"></script>
<link rel="STYLESHEET" type="text/css" href="js/dhtmlx/grid/dhtmlxgrid.css">
<link rel="STYLESHEET" type="text/css" href="js/dhtmlx/grid/skins/dhtmlxgrid_dhx_skyblue.css">
<script src="js/dhtmlx/grid/dhtmlxgrid.js"></script>
<script src="js/dhtmlx/grid/dhtmlxgridcell.js"></script>
<script src="js/dhtmlx/grid/ext/dhtmlxgrid_filter.js"></script>
<script src="js/dhtmlx/grid/ext/dhtmlxgrid_srnd.js"></script>
<script src="js/dhtmlx/grid/excells/dhtmlxgrid_excell_acheck.js"></script>
<script src="js/dhtmlx/grid/ext/dhtmlxgrid_drag.js"></script>
<link rel="stylesheet" type="text/css" href="js/dhtmlx/tree/dhtmlxtree.css">
<script src="js/dhtmlx/tree/dhtmlxtree.js"></script> 
[/code]

but when i call

grid = new dhtmlXGridObject(form.getContainer("gridValori"));

i got this error messagge:

TypeError: form.getContainer is not a function

Thank you.

Jacopo

Hi
Could you create a ticked with attached demo in support system?

I too faced the same problem though we have included/imported dhtmlx.js file that usually has all the components.
I have explicitly added the file dhtmlxform_item_container.js and imported after the above import and it worked.
I now have two imports like the below -

Hello, ckiran83
If you have version older than 3.6 - we suggest to upgrame your version to 3.6.
f you use the PRO Edition please, send completed demo on support@dhtmlx.com with link to this topic. If you have standard - attach demo here.
docs.dhtmlx.com/doku.php?id=othe … leted_demo

hi to all

  1. inludes sequence seems ok, should be form than container
  1. type of problem (form.getContainer is not a function) can be in case if functionality form file “dhtmlxform_item_container.js” was not applied to functions from “dhtmlxform.js”, i.e.

form.js have:
function dhtmlXForm(){};

form_item_container.js have:
dhtmlXForm.prototype.getContainer = function(){};

make sure all files were loaded on a page correctly (just open firebug, check console tab, it will have warn in red if file not found), if no warn - check in console - typeof(dhtmlXForm), typeof(dhtmlXForm.prototype.getContainer), form instanceof dhtmlXForm

  1. dhtmlx.js should have container inside, no needs to attach extra js

  2. the following code

depending on content of dhtmlx.js - if it compiled library (as usual) - will override all separate js files attached above. if you want to use separate js files for each component I suggest you also use separate for message

  1. if this will not help - completed demo