简体   繁体   English

单击边框时,项目单击不会触发事件

[英]Item click doesn't fire event when clicking on border

I have a strange problem with the event, itemclick on Extjs and the selection model of type checkboxmodel . itemclick事件有一个奇怪的问题,即itemclick上的itemclick和类型为checkboxmodel的选择模型。

I defined a tree panel, and in the configuration I set: 我定义了一个树面板,并在配置中设置:

selType: 'checkboxmodel',
selModel: {
    mode: 'SINGLE'
},

After, in the controller, attach the event to the function: 之后,在控制器中,将事件附加到函数:

init: function() {
    this.control({
        'MyTree': {
             itemclick: this.openItem
         }
    });
},

Everything works perfectly except when I click inside the item, in the minimum border separating the items. 除了当我在项目内部单击时(在项目之间的最小边框中),一切都可以正常工作 In that case, the checkbox changes, but the event doesn't fire. 在这种情况下,复选框会更改,但事件不会触发。

I tried with the event onmousedown and itemdblclick but the result is the same. 我尝试了onmousedownitemdblclick事件,但结果是相同的。 Is there any way to prevent this?. 有什么办法可以防止这种情况?

您应该使用select事件而不是click ,因为您的意图是对选择做出反应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM