Sencha treepanel 체크박스 체크하면 css 적용하기

2024. 12. 21. 22:32Javascript/Sencha

Ext.fly().toggle.Cls 사용

{ 
    xtype: 'checkcolumn', dataIndex: 'check', width: 50, 
    listeners: {
        checkchange: function (column, rowIndex, checked, record) {
            record.commit(); // Commit changes to reflect visually
            
            // Apply a CSS class to visually indicate deletion
            const view = column.up('treepanel').getView();
            const rowNode = view.getNode(record); // Get the DOM node for the row
            console.log(rowNode);
            if (rowNode) {
                console.log('222222222222222222222222222');
                Ext.fly(rowNode).toggleCls('marked-for-deletion', checked);
            }
        }
    }
},