If call GridBase.loadStyles method, it will read the object containing all areas of the style sheet and several dynamic style set settings and change the overall display information of the grid at once. In the example below, it reflects two themes defined in separate files named "flatbluestyles.js" and "graystyles.js".
GridBase.clearStyles remove all style values set apart from the default styles of the grid.
Of course, the theme object can be transferred in any way, such as creating in the location in which call it directly. Most commonly as this example, it prepares the theme script separately in the server or reflects in the load according to the request after saving in the database, etc.
grid.loadStyles(flatbluestyles);
// or directly
grid.loadStyles({
default: {},
grid: {},
body: {},
...
});
$.ajax({
url: "/repo/grid/resource/data/flatbluestyles.json",
dataType: 'json',
success: function (data) {
grid.loadStyles(data);
}
});