The FlexGrid has a columnLayout property that gets or sets a JSON string containing a list of grid columns and their properties.
This sample uses the columnLayout property to persist the column layout to the browser's localStorage using the following code:
// save or restore column layout in localStorage
function saveColumnLayout(flex) {
localStorage['columns'] = flex.columnLayout;
}
function loadColumnLayout(flex) {
var columnLayout = localStorage['columns'];
if (columnLayout) {
flex.columnLayout = columnLayout;
}
}
To see how this works, follow these steps: