Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by DhtmlxEvaluator on Jul 13, 2008 17:29
open dhtmlx forum
Subgrid using json

is it possible to use subgrid in json? Currently I am loading the data using json format using parse. I am doing this because the initial call is a servlet.
Answer posted by Support on Jul 14, 2008 03:53
The subgrids was designed to work with XML datasource, but they can be used with any custom logic by using in-grid events

grid=new ....
....
grid.setColTypes("sub_row_grid,ro,ro,ro")
...

grid.attachEvent("onSubGridCreated",function(subgrid,id,index,value){
    // this code will be called each time when subgrid opened , any code to init subgrid can be placed here
    // value - value of related cell in original datasource, url of xml file in original design

    subgrid.parse(subgrid_data);

    return false; // block defaults
});


grid.parse({
    rows:[
       { id:1, data:["1","2","3","4"] }
     ]
})