ExtJs 4.1 TreeGrid Treecolumn Custom Icon

Posted By Vitaliy | September 05, 2012 | ExtJS 4.1.0
0 5103
To set treecolumn icon you can use "iconCls" property.

Js Code

Ext.define('MenuItem', {
    extend: 'Ext.data.Model',
    idProperty: 'Id',
    fields: [
        { name: 'Id', type: 'string' },
        { name: 'Name', type: 'string' },
        { name: 'Disabled', type: 'bool' },
        {
            name: 'iconCls',
            type: 'string',
            convert: function (v, r) {
                return r.get('Disabled') ? 'icon-disabled' : 'icon-enabled'
            }
        }
    ]
});