FlexGrid refresh grid with different columns

Question!

I'm currently testing wijmo5. One thing I would like to do is after a FlexGrid is loaded, I would like to reload the grid with different columns. Note that I don't want to just hide columns. I want to actually load completely different columns. I've tried calling initialize again with the different desired columns, but that only appends the columns and causes duplicate columns to show up.



Answers

The secret here is to prevent the grid from creating the columns for you automatically. You can do that by setting the "autoGenerateColumns" property to false.

This fiddle shows how you can select a set of columns to display on command:

http://jsfiddle.net/Wijmo5/djL2ouk1/

The interesting code is the "showColumns" function which is implemented as follows:

// show the specified columns in the grid
$scope.showColumns = function(cols) {
    $scope.flex.columns.clear();
    cols = cols.split(',');
    for (i = 0; i 
By : Bernardo


This video can help you solving your question :)
By: admin