View Full Version : Accessing itemcontextmenu params from menu

25 Oct 2012, 5:23 PM

I'm fairly new to the whole context menu thing, but I've been working through the action grid example here:


T (http://docs.sencha.com/ext-js/4-1/#!/example/menu/action-grid.html)his has been pretty helpful, but it assumes that the menu action handler has a named reference to the grid object in the current binding. I'm looking to use a factory of sorts and while I might be able to structure such that I can form a closure or get the binding right, it'd be more flexible if I could just access the arguments to the itemcontexthandler through the menu item. Barring that, if I could traverse from the action through the menu up to the parent grid, I could make do with that. Ultimately I just want the record for the current row.

I'm sure I could come up with a way to do this, but is there something built-in to ExtJS for this sort of stuff? Or what's the best practice around it?


26 Oct 2012, 4:50 AM
A menu factory method seems to work fine. Since I'm not anticipating a lot of right-clicks here, GC shouldn't be a problem. So I could just roll with this. But I'd still be interested in knowing if from either the "widget" or "event" arguments if one could get a handle to the row/record/grid that was clicked on.