View Full Version : make the node of the treelist as disabled after it is rendered by ajax proxy

18 Dec 2019, 3:32 AM

I have a treelist which i am loading using an ajax proxy store. After loading, i need to decide which of my nodes has to be set using a specific css class(to show it as disabled or enabled node) . How can i achieve this using a viewConfig. I am using Ext JS 7 Classic. Someone please suggest me how to do this. Thanks in advance

NOTE: Please note i am using a treelist and not a treepanel (Ext JS Classic)

I have something like this.

xtype: 'treelist',
bind: {
store: '{navItems}' // This is a proxy store filled up with an ajax request
defaults: {
xtype: 'treelistitem',
viewConfig: {
getRowClass: function (record, rowIndex, rowParams, store) {
console.log('record-----', record); // This does not get called at all
return 'row-disabled-modified';
listeners: {
'contextmenu': {
element: 'element',
fn: someFn',
preventDefault: true,

Please suggest me how can i do this.

3 Jan 2020, 1:33 AM
There is no viewConfig on TreeList.
You could use rowClsProperty (https://docs.sencha.com/extjs/7.0.0/classic/Ext.list.TreeItem.html#cfg-rowClsProperty) : The name of the associated record's field to map to the rowCls (https://docs.sencha.com/extjs/7.0.0/classic/Ext.list.TreeItem.html#cfg-rowCls) config.

16 Jan 2020, 3:54 AM
Hi thanks.. and sorry for the very late reply.