ExtJS:复选框检查不应在树节点中选择

时间:2016-06-07 07:41:42

标签: extjs extjs5

选中复选框后,它会选择节点并触发'select'监听器(实际上它也会触发各种点击,单击活动)

我有两个不同的功能,用于复选框检查和选择节点。所以现在我无法区分检查和选择。

Ext.define("App.view.search.resultTree", {
extend: "Ext.tree.Panel",
alias: 'widget.resultTree',
id: 'resultTree',
title: 'Results',
rootVisible: false,
useArrows: true,
border: 0,
autoScroll: true,
height: 680,

emptyText: Messages.EmptyText.NoDataFound,

viewModel: {
    type: "resultViewModel"
},

store: Ext.create('Somestore'),

listeners: {
    checkchange: function (node, checked) {

        node.eachChild(function (n) {
            node.cascadeBy(function (n) {
                    n.set('checked', checked);
                }
            );
        });


    },

    rowmousedown:function(){
        console.log('in rowmouse down');
    },

    itemclick:function(){
        console.log('in itemclick');
    },

    cellclick: function(){
        console.log('in cellclick');
    },

    select: function(){
        console.log('in selection');
    }
}
})

0 个答案:

没有答案