SMART datagrid v.1 > Examples

Back  Forward

Load Styles  Example

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. 

 

Grid - 1
rows

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. 

Code -1
    grid.loadStyles(flatbluestyles);
    
    // or directly
    grid.loadStyles({
        default: {},
        grid: {},
        body: {},
        ...
    });

 

Code -2
    $.ajax({
		url: "/repo/grid/resource/data/flatbluestyles.json",
    	dataType: 'json',
    	success: function (data) {
    	    grid.loadStyles(data);   
    	}
    });

 

View Source JSP 

See Also
loadStyles
Style Overview
Grid Style Sheet
Examples
Column Styles
Row Styles