【发布时间】:2016-06-13 23:45:35
【问题描述】:
我有一个包含多个网格的布局,它们都使用 RowEditing 插件。我正在尝试使用 Ext.ComponentQuery.query 来访问特定网格上的嵌入式 RowEditor 按钮,但无法弄清楚如何正确遍历事物。我想知道它是否与动态添加的 RowEditor 和按钮有关 - 尽管我找不到任何东西来确认是否符合预期。
编辑添加 jsfiddle http://jsfiddle.net/ttubbs/eadfpxao/
在每个网格中激活 RowEditing 后(双击每个网格中的一行),在控制台中运行以下命令会产生指示的结果...
Ext.ComponentQuery.query("roweditorbuttons") // two results
Ext.ComponentQuery.query("roweditorbuttons > #update") // two results
Ext.ComponentQuery.query("#grid1 > roweditorbuttons") // no results
Ext.ComponentQuery.query("#grid1 > #update") // no results
Ext.ComponentQuery.query("roweditorbuttons > button[text=Update]") // two results
我需要能够执行以下操作,但查询不起作用:
Ext.ComponentQuery.query("#grid2 > #update") // give me the update button in #grid2
Ext.ComponentQuery.query("#update").up().itemId === "grid1" // determine which grid my button is in
问题是:
- 给定一个网格 (#grid1[1]),如何访问行编辑器 纽扣?
- 给定一个按钮 (#update[0]),我如何才能访问它 父网格?
【问题讨论】:
标签: javascript extjs