refreshes the structure of DataTable
config | array | an array with new configurations for the columns |
reset | boolean | if true, shows columns hidden by user (false by default) |
dtable.refreshColumns();
When used without an argument, the method repaints the current grid structure.
You can use this method to refresh the structure of datatable after modifying some properties of the columns collection.
dtable.config.columns[2].id = "newPrice";
dtable.config.columns[2].width = 500;
dtable.refreshColumns();
Or to change columns completely:
var config = [
{id:"col1", header:"First Name", width:150},
{id:"col2", header:"Last Name", width:150}
];
dtable.refreshColumns(config);