Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
150
How to populate hierarchial grid using client-side script?
posted

I have a 2-level grid showing log entries and details for each log entry. I am able to populate the log entries, i.e., first level, using client-side script.

var grid = igtbl_getGridById("my_grid");

for (var i = 0; i < result.length; i++) {  var row = grid.Rows.addNew();

  row.getCell(0).setValue('value 0');

  row.getCell(1).setValue('value 1');

  ...

}

  1. How do I populate the 2nd level entries for each 1st level entry using client-side javascript?
  2. Can this be done on demand using javascript? That is, only populate the detail when the user tries to expand the parent level.

 

Thank you,

Girish

Parents
  • 28464
    posted

    Hello Girish, 

    Thanks for writing. I believe you can take advantage of the client-side Bands collection of the grid to get to the second band (child band) and then use the client-side methods of the Band iteself

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WebGrid_Object_CSOM.html 

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WebGrid_Band_Object_CSOM.html 

    In any case, I believe in your scenario you are looking for AJAX (the child band comes on demand via Ajax Calls), so this might be the easier approach here (as opposed to using client-side javascript code).

    You can check out the "AJAX" examples in our samples browser located here: 

    http://samples.infragistics.com/2008.2/webfeaturebrowser/default.htm 

Reply Children
No Data