SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.columnsByField  method

Return all Columns being connected to DataField specified by field as array. 

field can be the field index or field name. If ignoreCase is true when specifying as field name, it will not be case sensitive. You can get the first column connected to the field through columnByField. If there is no corresponding column, it will return null

function columnsByField (field: Integer|String, ignoreCase: Boolean): [GridColumn];
Returns
[GridColumn]
Parameters
field - Integer|String. required.
ignoreCase - Boolean. Defaults to false.
When specify the field name in field, if it is true, it will not be case sensitive.
Code -1
    $('#check').click(function () {
        var columns = grid.columnsByField('fldAddr');
        if (columns) {
            for (var i = columns.length; i--;) {
                columns[i].setStyles({
                    background: '#1000ff00'
                }
            }
        }
    });
See Also
columnByField
GridColumn
DataField