Adding a column to the flexGrid programmatically

Posted by: marclerman on 14 September 2017, 11:30 am EST

  • Posted 14 September 2017, 11:30 am EST

    Hello,

    I am looking at the flexGrid for the first time, prior to a real evaluation, and one thing I did not see how to do was to programmatically add a column after the grid had been fully rendered.

    A simple example I tried has a flexGrid that is filled with some sample data, with a button below. The button’s ng-click (I’m using Angular 1) is wired to do the following:

    [js]var flex = $scope.flex;

    flex.columns.push({ header: ‘New column’});[/js]

    And this completely messes up the grid, with an exception in the console.

    What is the recommended way to add (or remove) a column with an instantiated grid?

    Thanks!

  • Posted 14 September 2017, 11:30 am EST

    Found it:

    [js]flex.columns.push(new wijmo.grid.Column({ header: ‘New column’}));[/js]

  • Posted 13 September 2018, 1:59 pm EST

    Thanks. I needed this…

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels