Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Anil on Apr 09, 2008 10:48
open dhtmlx forum
Subgrid events.

Hi,

How do we capture the subgrid from the parent grid and will we be able to invoke Grid API methods, e.g. If we are intrested in checking what has been edited in subgrid? and whether to commit them at backend or not?

e.g. getChangedRows() etc.
Answer posted by Support on Apr 10, 2008 01:59
You can get the subgrid object by
    grid.cells(i,j).getSubGrid();
where i,j - coordinates of sub_row_grid cell

The grid provides onSubGridCreated event which can be used to attach custom events to sub grid

    grid.attachEvent("onSubGridCreated",function(subgrid){
       subgrid.attachEvent("onEditCell",function(){
             //any custom code here
        })
    });

http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Sub_rows_new_data_dim.html#grid_subrowsndd
http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Excell_API_reference.html#grid_excellsapi