SMART datagrid v.1 > Classes > GridColumn

Back  Forward

DataLudi.GridColumn.styleName  property

The style set name registered as registerColumnStyles in grid. 

This style set is used as the most basic styles when draw column cells. In other words, the style properties which specified in column Style or other dynamic styles will take precedence. 

You can make dynamic style effect by registering various styles and changing this property based on conditions during run time. 

Getter
function styleName(): String
Setter
function setStyleName(value: String)
Code -1
    grid.registerColumnStyls({
        yellow: {
            background: '#ff0',
            color: '#333'
        },
        red: {
            background: '#f00',
            color: '#fff'
        }
    ]);
    
    $('#btnChangeColor').click(function () {
        var col = grid.columnByName('price');
        if (limit > 100) {
            col.setStyleName('red');
        } else {
            col.setStyleName('yellow');
        }
    });
See Also
registerColumnStyles
unregisterColumnStyles
clearColumnStyles
styles
Examples
Column Styles