Hello,
I have a Kendo Grid (called 'overallGrid' in my example) with some columns formatted as percentages with one decimal place ( format: "{0:p1}" ). I also have a View Model with a Select element, where the user can change what values they wish to see in the columns. What I need to do is, when they pick a certain option in the Select element, the formatting of the columns should be changed to be a decimal with 1 decimal place, rather than a percentage.
At the moment, I have this in the "click" event of a "update grid" button;
if (viewModel.score == 'Mean') {
overallGrid.columns[1].format = '{0:n1}';
overallGrid.columns[3].format = '{0:n1}';
}
overallGrid.dataSource.filter( [
{ field: "score", operator: "eq", value:viewModel.score},
]);
overallGrid.dataSource.read();
overallGrid.refresh();
When run, the formatting on the rendered grid does not change, even though I can see that the "columns.formatting" of the Grid object has been changed when I inspect the object in Firebug.
What am I doing wrong? Thanks!