使用Ext.selection.RowModel(默认)selModel时,会执行哪些ExtJS 4.2标准函数来进行网格选择? [英] What ExtJS 4.2 standard function gets executed for grid selection when using Ext.selection.RowModel (default) selModel?

查看:435
本文介绍了使用Ext.selection.RowModel(默认)selModel时,会执行哪些ExtJS 4.2标准函数来进行网格选择?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当将嵌套网格设置为renderTo到rowexpander div id时,Ext.grid.Panel rowexpander插件的工作方式存在错误.

实现此功能后,很难看到实际选择了什么.这样做的原因是因为配置"disableSelection"和"trackMouseOver"都将被考虑用于突出显示.我必须设置"trackMouseOver:false",以便将鼠标悬停在网格行上不会干扰此行为.然后必须设置"disableSelection:false",以便确实发生此选择问题.

问题在于,当您选择父网格的索引0行的嵌套网格的索引1时,父网格的索引1行也会被选择.如果选择父网格索引0行的嵌套网格的索引2,则父网格索引2也将被选择.

当935424被选择时,815138被选择,因为它们都是索引0.

选择1056257时,因为它们都是索引1,所以选择了1013525.

选择1200191时,由于它们都是索引2,所以选择了1261631.

我怀疑选择模型实例可能会与网格和嵌套网格共享,因为我使用的是相同的定义.它们当然是相同定义的不同实例,但是我不确定框架如何使用Ext.create处理其他网格?

我想问一下如何解决它或让我靠近,我会(通常)向您投票.但是,如果至少可以为我提供一个关于在框架中调用此选择函数的线索,那将使我走上正确的道路,并可以调试和发现针对此问题的修复程序.我已经读到事件可能会冒出来,也许这就是这里正在发生的事情.该行似乎也有一个句柄,因为当我双击嵌套的网格行时,它不仅尝试扩展该行,还尝试扩展父网格行(与行索引匹配)中的行.

解决方案

在创建任何递归嵌套网格之后,我必须调用此行,以便click和dblclick(及其他)事件不会冒泡/传播到父级网格.

grid[cnt].getEl().swallowEvent(['mouseover', 'mousedown', 'click', 'dblclick', 'onRowFocus']);

There is a bug with the way the Ext.grid.Panel rowexpander plugin works when a nested grid is set to renderTo to the rowexpander div id.

When this is implemented, it's difficult to see what is actually being selected. The reason for this is because the config "disableSelection" and "trackMouseOver" are to be both considered for highlighting. I have to set "trackMouseOver: false" so that hovering over grid rows doesn't interfere with reproducing this behavior. Then "disableSelection: false" must be set so that this selection issue does actually occur.

The issue is that when you select index 1 of the nested grid of parent grid index 0 row, index 1 row of parent grid is selected as well. If you select index 2 of the nested grid of parent grid index 0 row, index 2 of parent grid is selected as well.

When 935424 is selected, 815138 is selected since they are both index 0.

When 1056257 is selected, 1013525 is selected since they are both index 1.

When 1200191 is selected, 1261631 is selected since they are both index 2.

I'm suspecting that the selection model instance might be getting shared with the grid and nested grids since I'm using the same definition. They are of course different instances of the same definition, but I'm not sure how the framework handles additional grids using Ext.create?

I'd like to ask how to fix it or get me close, I'll be up-voting you (often). But if you can at least give me a clue as to where this selection function is being called in the framework, that will get me on the right track and can debug and discover a fix for it. I've read that events can bubble, and maybe that's what's happening here. It seems to have a handle on the row as well, because when I double click the nested grid row, it not only tries to expand that row, but also the row from the parent grid row (that matches the row index).

解决方案

After any recursive nested grid is created, I had to call this line so the click and dblclick (and others) events don't bubble/propagate to the parent grid.

grid[cnt].getEl().swallowEvent(['mouseover', 'mousedown', 'click', 'dblclick', 'onRowFocus']);

这篇关于使用Ext.selection.RowModel(默认)selModel时,会执行哪些ExtJS 4.2标准函数来进行网格选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆