我所拥有的是一个项目选择器,其中包含可用用户并将用户分配为两个不同的列。单击可用用户中的任何用户并单击不同的菜单选项时,仍会显示从可用用户列中选择的用户。单击其他菜单时如何清除选择?
以下是在特定菜单下进行选择时屏幕的外观:
我尝试访问 store 和 clearValue() 和 setValue('') ,这不是正确的解决方案,并且我无法访问 selecitonModel 以在此处执行 clearSelections() 。
如何在单击菜单时清除选择?
非常感谢您的帮助,非常感谢。
我所拥有的是一个项目选择器,其中包含可用用户并将用户分配为两个不同的列。单击可用用户中的任何用户并单击不同的菜单选项时,仍会显示从可用用户列中选择的用户。单击其他菜单时如何清除选择?
以下是在特定菜单下进行选择时屏幕的外观:
我尝试访问 store 和 clearValue() 和 setValue('') ,这不是正确的解决方案,并且我无法访问 selecitonModel 以在此处执行 clearSelections() 。
如何在单击菜单时清除选择?
非常感谢您的帮助,非常感谢。
You can use the getSelectionModel().deselectAll() method of the "Users View" (that you want to clear the selection) within the listener select from the "Roles View". This will cause all user record selections to be removed when selecting a different menu. See docs: getSelectionModel, deselectAll.
Example:
{
xtype: 'dataview',
.
.
.
listeners: {
select: function(dataview, record, index, eOpts){
dataview.view.up('viewport').down('#usersView').getSelectionModel().deselectAll();
}
}
}
Within the listener, it performs the method to deselect all records from the target view.
These methods are commonly found in components that have the selection behavior, such as the grid.
See this fiddle: Deselect DataView Items.
store.removeAll();
这是你想要的