I have a layout with multiple grids, and they all use RowEditing plugin. I am trying to use Ext.ComponentQuery.query to get access to the embedded RowEditor buttons on specific grids, but am unable to figure out how to properly traverse things. I wonder if it has to do with the RowEditor and buttons being added dynamically - though I cannot find anything to confirm that is expected or not.
Edited to Add jsfiddle http://jsfiddle.net/ttubbs/eadfpxao/
Once the RowEditing has been activated in each grid (double click a row in each one), running the following in the console produces indicated results...
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
I need to be able to do something like the following, but the queries don't work:
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
The questions are:
- Given a grid (#grid1[1]), how can I get access to the row editor buttons?
- Given a button (#update[0]), how can I get access to its parent grid?
