Categories | Question details Back To List | ||||||||
DhtmlGrid don't shows up in the Dhtml Tabbar Hi. I'm using a dhtmltabbar and I have successfully initialize. In one of my bars I have to initialize dhtmlGrid. I also have initialize the grid,but it only shows the header rows not the data in the grid. Debugging with the debugger it says that data are loaded from xml successfully and exist in the request but it not shown in the grid. Also I made html element inspection and the data exist but it's not shown.bellow I'm pasting my code: here is the code for the tabbars <div id="a_tabbar" class="dhtmlxTabBar" imgpath="js/dhtmlx/dhtmlxTabbar/codebase/imgs/" style="width:398; height:395;" skinColors="#FCFBFC,#F4F3EE"></div> here is the function for creating tabs function createTabs(){ tabbar=new dhtmlXTabBar("a_tabbar","top"); tabbar.setImagePath("/admin/js/dhtmlx/dhtmlxTabbar/codebase/imgs/"); tabbar.enableAutoSize(false,false); tabbar.setOffset("3"); tabbar.loadXML("settings_elements_tabbar_content.xml"); } Here is the xml for the tabs <?xml version="1.0" encoding="utf-8"?> <tabbar hrefmode="ajax"> <row> <tab id="t1" width="100" name="Info" href="settings_elements_tabbar_content_info.php"> Info </tab> <tab id="t2" width="100" name="Content" href="settings_elements_tabbar_content_content.php"> Content </tab> <tab id="t3" width="100" name="Design" href="settings_elements_tabbar_content_design.php"> Design </tab> <tab id="t4" width="100" name="D'Props" href="settings_elements_tabbar_content_properties.php"> D'Props </tab> <tab id="t5\" width="100" name="Code" href="settings_elements_tabbar_content_code.php"> Code </tab> </row> </tabbar> All scripts works correctly and correctly display data. Here is the D'Props Tab content: <?php header("Content-type: text/xml; charset=utf-8"); header("Pragma: no-cache"); ?> <content> <![CDATA[ <h3 style="color:#055A78;">Element properties</h3> <div id="gridbox" style="background-color:white;overflow:hidden"></div> <script> createGridinTab('gridbox'); </script> <a id="addnewitem" href="javascript:;" onclick="addTabbarBlankNavitem();">Add new item</a> ]]> </content> here is the function for creatig the grid:(I use hardcoded tabs and hardcoded xml): mygrid = new dhtmlXGridObject(id); mygrid.imgURL = "/admin/js/dhtmlxGrid/codebase/imgs/"; mygrid.setHeader("Name,Value List,Default Value,Type"); mygrid.setInitWidths("173,173,173,170"); mygrid.setColAlign("left,right,left,left"); mygrid.setColTypes("ed,ed,ed,ed"); mygrid.setColSorting("str,str,str,str"); mygrid.setSkin("xp"); mygrid.init(); mygrid.loadXML("settings_elements_tabbar_content_grid.php"); And here is the xml for the grid <?php header("Content-type:text/xml"); header("Pragma: no-cache"); print('<?xml version="1.0" encoding="UTF-8"?>'); print("\n<rows>"); print("\n\t<row id=\"1\">\n"); print("\t\t<cell>Teaser Lenght></cell>\n"); print("\t\t<cell><![CDATA[ <textarea name=\"a\" id=\"a\"></textarea>]]></cell>\n"); print("\t\t<cell></cell>\n"); print("\t\t<cell>user defined</cell>\n"); print("\t</row>\n"); print("\n\t<row id=\"2\">\n"); print("\t\t<cell>Image</cell>\n"); print("\t\t<cell></cell>\n"); print("\t\t<cell></cell>\n"); print("\t\t<cell>user defined</cell>\n"); print("\t</row>\n"); print("\n\t<row id=\"3\">\n"); print("\t\t<cell>Image Size</cell>\n"); print("\t\t<cell></cell>\n"); print("\t\t<cell></cell>\n"); print("\t\t<cell>user defined</cell>\n"); print("\t</row>\n"); print("\n\t<row id=\"4\">\n"); print("\t\t<cell>Image position</cell>\n"); print("\t\t<cell></cell>\n"); print("\t\t<cell></cell>\n"); print("\t\t<cell>user defined</cell>\n"); print("\t</row>\n"); print("\n\t<row id=\"5\">\n"); print("\t\t<cell>Background Color</cell>\n"); print("\t\t<cell></cell>\n"); print("\t\t<cell></cell>\n"); print("\t\t<cell>user defined</cell>\n"); print("\t</row>\n"); print("\n\t<row id=\"6\">\n"); print("\t\t<cell>Content Article</cell>\n"); print("\t\t<cell></cell>\n"); print("\t\t<cell></cell>\n"); print("\t\t<cell>select</cell>\n"); print("\t</row>\n"); print("\n</rows>"); I've also test it my xml on www.w3schools.com/Dom/dom_validate.asp and it's valid(both xml for tabbar and grid) Can you please help me?I'm trying with this two days and I can figure out where i'm wrong. Answer posted by Alex (suppot) on Sep 07, 2009 02:00 Hello, please check that grid has some height and width. The sample is attached Attachments (1)
Answer posted by Blagoj on Sep 08, 2009 03:35 Thanks for the response.That was the problem(in height and width).I didn't set it up. So now I tried and it works. I also tried with pixels and it works too,but don't work if the width and height are set to auto. Thanks again for great support. |