0
votes

I have ext treepanel and checkcolumn inside.... So I need to prevent unchecking some of nodes of tree. For example I have tree with categories... And category with ID 5 has to be always checked...,

I've added listener for checkcolumn but the only I catch is row index and I cannot find model by this index and equate record id to my category...

        'categoryViewWindow treepanel checkcolumn'           : {
            beforecheckchange : function(holder, rowIndex, checked, eOpts){
                debugger;
            }
        }
1
Can anyone provide insight into this? I'm facing the same problem. Supposedly, you can return false from event handlers and prevent the checkbox from being checked or unchecked, but that does not work for me.Greg Lafrance

1 Answers

0
votes

So Ive done it something like this in my controller

this.control({
            'categoryViewWindow checkcolumn'      : {
                checkchange: me.checkCategoryView,
            }
});

And method

checkCategoryView: function () {
    var me = this,
        categoriesViewStore = me.getCategoriesViewStore(),
        myId;

    if (category && category.get('id') != -1) {
        foundCategory = categoriesViewStore.getNodeById(myId);

        if (foundCategory) {
            foundCategory.set('added', true);
        }
    }
},

So after change I check my category forcibly