Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by LeitrimMan on Dec 11, 2009 07:57
open dhtmlx forum
subgrid resize issue

Hi,

I have a grid with a subgrid. When I click to open the subgrid, the main grid does not resize, i.e. the subgrid lies on top of the main grid. However, when I click to close the subgrid, and then click to open it, the main grid reszies correctly. Perhaps the data for the subgrid is now cached or something and the grid is able to resize properly or in time on the second resize but not on the first (data load)?

heres the code...

jobCalloutGrid.setHeader(' ,Crew,Task,Callout,Date,Start,Hours,Rate,Location,Contact,Status');
jobCalloutGrid.setColAlign("right,right,left,left,left,right,right,right,left,left,left");
jobCalloutGrid.setColTypes("sub_row_grid,ed,coro,coro,ed,ed,ed,ed,ed,ed,ed");    
jobCalloutGrid.setInitWidths("30,65," + calloutVarWidth + "," + calloutVarWidth + ",80,60,60,60," + calloutVarWidth + "," + calloutVarWidth + ",100");
jobCalloutGrid.setSkin('light');

jobCalloutGrid.attachEvent("onSubGridCreated",function(sub,id,ind,value){        
sub.setSkin('modern');    
sub.setHeader("Emp #,Name,Mobile,Status,Extra,Late");
sub.setInitWidths("61,"+ calloutVarWidth + "," + calloutVarWidth + ",80,60,60");
sub.loadXML("jobdetail2.php?action=crewcallouts&CalloutID=10");
sub.init();
});
Answer posted by dhxSupport on Dec 14, 2009 05:25
What version of dhtmlxGrid do you use? Please try to add setSizes() to the main grid after sub grid is opened:
jobCalloutGrid.attachEvent("onSubGridLoaded", function(sub_grid_obj,rId,rInd){
   jobCalloutGrid.setSizes();
});
Answer posted by LeitrimMan on Dec 14, 2009 08:36
Hi,  version is //v.2.5 build 090904, I tried setSizes on the main grid but the problem remains..
Answer posted by dhxSupport on Dec 15, 2009 02:35
Please provide us complete example where we can reproduce this issue. (Please send such example directly to the support@dhtmlx.com)
Answer posted by LeitrimMan on Dec 15, 2009 03:19

Hi Guys,

I resolved this problem, I was using a loadXML call in the onSubGridCreated to load data into the subgrid, but when I changed this to put the URL into the first column of the main table the resize issue resolved itself.