Categories | Question details Back To List | ||
The dhtmlxObject's container(The div) can be autosize? The dhtmlxGrid or dhtmlxTree are created in a div.At first,we should give the div width and height,which always make the scrollbar visible. I want to know.Is there any way to make the div be autosize(based on the data rows) ,so the scrollbar is not visible. Answer posted by Support on Aug 14, 2008 01:25 You can enable auto-height of grid, in such mode, height of grid container will be encreased automatically , according to used rows. grid.enableAutoHeight(true); Answer posted on Aug 14, 2008 02:26 when i use it, web page is erro , ie give a erro,which is no such property . I use dhtmlxtreegrid grid.enableAutoHeight(true); Answer posted by Support on Aug 14, 2008 03:01 Which version of component you are using? The command exists in both dhtmlxgrid and dhtmlxtreegrid starting from version 1.4 Answer posted on Aug 14, 2008 18:51 I use 1.5 version.the keyword "enableAutoHeight" is searched in dhtmlxgrid.js. The order of js's introduction will be impact it? or the enableAutoHeight's call time is erro?
-----------------------------
<link rel="STYLESHEET" type="text/css" href="../js/dhtmlobj/dhtmltreegrid/css/dhtmlxgrid_skins.css">
<link rel="STYLESHEET" type="text/css" href="../js/dhtmlobj/dhtmltreegrid/css/dhtmlXGrid.css"> script src="../js/dhtmlobj/dhtmltreegrid/js/dhtmlXGrid.js"></script>
<script src="../js/dhtmlobj/dhtmltreegrid/js/dhtmlXGridCell.js"></script> <script src="../js/dhtmlobj/dhtmltreegrid/js/dhtmlXTreeGrid.js"></script> <script src="../js/dhtmlobj/dhtmltreegrid/js/ext/dhtmlxgrid_selection.js"></script>
<script src="../js/dhtmlobj/dhtmltreegrid/js/dhtmlXGrid_excell_link.js"></script> <script src="../js/dhtmlobj/dhtmltreegrid/js/excells/dhtmlxgrid_excell_acheck.js"></script> <script src="../js/dhtmlobj/dhtmltreegrid/js/excells/dhtmlxgrid_excell_grid.js"></script> mygrid = new dhtmlXGridObject('gridbox');
mygrid.selMultiRows = true; mygrid.imgURL = "../js/dhtmlobj/dhtmltreegrid/imgs/"; mygrid.setHeader("xx,yy,zz"); mygrid.setInitWidths("260,50,50") mygrid.setColAlign("left,center,center") mygrid.setColTypes("tree,ro,ro"); mygrid.setColSorting("str,str,str") mygrid.setColumnColor("white,#def7ff,white"); mygrid.enableAutoHeight(true,100,100); mygrid.init();
mygrid.enableSmartXMLParsing(true);
mygrid.kidsXmlFile="../servlet/CkServlet"; var v_url="xxxxxxx"; mygrid.loadXML(v_url); Answer posted on Aug 14, 2008 19:24 <link rel="STYLESHEET" type="text/css" href="../js/dhtmlobj/dhtmltreegrid/css/dhtmlxgrid_skins.css">
<link rel="STYLESHEET" type="text/css" href="../js/dhtmlobj/dhtmltreegrid/css/dhtmlXGrid.css"> script src="../js/dhtmlobj/dhtmltreegrid/js/dhtmlXGrid.js"></script>
<script src="../js/dhtmlobj/dhtmltreegrid/js/dhtmlXGridCell.js"></script> <script src="../js/dhtmlobj/dhtmltreegrid/js/dhtmlXTreeGrid.js"></script> <script src="../js/dhtmlobj/dhtmltreegrid/js/ext/dhtmlxgrid_selection.js"></script>
<script src="../js/dhtmlobj/dhtmltreegrid/js/dhtmlXGrid_excell_link.js"></script> <script src="../js/dhtmlobj/dhtmltreegrid/js/excells/dhtmlxgrid_excell_acheck.js"></script> <script src="../js/dhtmlobj/dhtmltreegrid/js/excells/dhtmlxgrid_excell_grid.js"></script> mygrid = new dhtmlXGridObject('gridbox');
mygrid.selMultiRows = true; mygrid.imgURL = "../js/dhtmlobj/dhtmltreegrid/imgs/"; mygrid.setHeader("xx,yy,zz"); mygrid.setInitWidths("260,50,50") mygrid.setColAlign("left,center,center") mygrid.setColTypes("tree,ro,ro"); mygrid.setColSorting("str,str,str") mygrid.setColumnColor("white,#def7ff,white"); mygrid.enableAutoHeight(true); mygrid.init();
mygrid.enableSmartXMLParsing(true);
mygrid.kidsXmlFile="../servlet/CkServlet"; var v_url="xxxxxxx"; mygrid.loadXML(v_url); Answer posted by Support on Aug 15, 2008 03:59 The order of js files and time of command call doesn't matter ( basically command need to be called before loading data in grid, but it not really critical ) Sample of same functionality with grid 1.5 sent by email By the way, your code snippet missing dhtmlxcommon.js , without which grid will not work at all. Answer posted on Aug 15, 2008 04:19 thank you very much. Answer posted on Aug 15, 2008 09:14 thak you! now The "enableAutoHeight" is working. but there is a strange thing has happened. In the page ,I have a dhtmlxcombo and a dhtmlxtreegrid.when the treegrid is enableAutoHeight, the dhtmlxcombo's position is very strange, It Deviate its location 50~100 px Answer posted by Support on Aug 15, 2008 09:43 If you have combo opened, and expand the grid after that - such behavior can really occur. The position of combo list is fixed , and not changed when surrounding layout shifted. You can try to add next code to grid's init grid.attachEvent("onOpen",function(){ combo.closeAll(); return true; )); |