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
15
Building grid dynamically
posted

Just to confirm I'm not insane--if the following works:

$( '#idGrid' ).igGrid(
 {
  ...
  features: [
   {
    name: 'GroupBy',
    columnSettings: [
     {
      columnKey: 'MpName',
      isGroupBy: true,
      dir: 'desc'
     }
    ]
   }
  ]
 }
);

...then the following should be expected to work as well, right??

var columnSettingsGroupBy = [];
...
columnSettingsGroupBy.push( { columnKey: 'MpName', isGroupBy: true, dir: 'desc' } );

$( '#idGrid' ).igGrid(
 {
  ...
  features: [
   {
    name: 'GroupBy',
    columnSettings: columnSettingsGroupBy
   }
  ]
 }
);

I have a loop iterating over column names and building my columnSettingsGroupBy array dynamically (pushing values into it based on settings saved in a file rather than being hardcoded), but ultimately the end result is the same.  So if I can confirm that the above can be expected to work...I'll know the problem probably lies within my loop somewhere (even though by the time it's done, my array looks the same).