Can cellcontextmenu handler pass params to menu
Is there a smart, scoped, way for my handler to pass current information to the menu--or really, to the menu item's handlers.
For example, take a grid for example. Assume that row 3, column 5 contains the value "foo". When you right-click this cell, a context menu pops and one of the menu items is "Hide all rows with this value". When you click that menu item, you want a handler to execute a custom FilterBy on the grid's store that will hide all rows where the 5th column = "foo".
So obviously, I need to somehow pass the value "foo" to the menu item's handler.
The way that context menus are created in the examples then displayed using contextMenu.showAt(#,#), I don't see how I can pass the value "foo" to the menu. (Alternatively, the right-clicked row and cell index would work or something that I can use to derive the value "foo".)
OK, now that I've written a book, what I'm asking is, what is the best way to pass a value from the cellcontextmenu handler to a menu's item handler?
Doh! I got to get comfortable with using javascript this way--that everything is an object with properties and methods. You can make up new properties simply by assigning values to them:
myContextMenu.row = grid.store.data.items[rowIndex];
myContextMenu.showAt([coords[0], coords[1]]);
Then, in the context menu item handlers, I can reference myContextMenu.row which gives me access to all the column's values.
Thanks, Animal.
#If you have any other info about this subject , Please add it free.# |

