Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by TonyW on Mar 16, 2008 16:16
open dhtmlx forum
Grid with sub grid

How is selected row retrieved for a sub grid. How is grid object defined when loaded from sub.xml?
Answer posted by Support on Mar 17, 2008 05:08
>>How is grid object defined when loaded from sub.xml?
The grid object fully based on configuration XML assigned to cell in question.
To get subgrid object you can use
    grid.cells(i,j).getSubGrid(); // where i,j - coordinates of sub_grid cell
Subgrid is fully functional instance of dhtmlxgrid, so any existing API can be used against it

    grid.cells(i,j).getSubGrid().getSelectedRowId()
Answer posted by TonyW on Mar 28, 2008 00:31

Your answer is fine but the problem appears to lie in ensuring that the 'parent cell' row is automatically selected when the expand event completes. A sample would be helpful or a pointer to the API method to achieve selection of the parent row.

Thanks

Answer posted by Support on Mar 28, 2008 03:36
With updated version of sub_row excell next code is possible

grid.attachEvent("onSubGridLoaded",function(subgrid,id,index){
    this.setSelectedRow(id);
});

Latest subgrid code can be grabbed from here
    http://dhtmlx.com/docs/products/kb/index.shtml?cat=search&q=2340
Answer posted on Apr 06, 2008 22:21

Help!

Getting error at this URL to download updated subgrid code (unexpected error try later) Several later tries unsuccessful

http://dhtmlx.com/docs/products/kb/index.shtml?cat=search&q=2340

 

Answer posted by Support on Apr 07, 2008 03:23
Please use attached js file
Attachments (1)