PDA

View Full Version : Help with ext-all-rtl-debug.js



jp2code
5 Nov 2015, 1:24 PM
I need to edit a file that contains Sencha's JavaScript library.

Sencha is creating a tree view control that has a custom context menu, and the context menu has options for adding and removing tree items to the tree view. I need to add new menu options to that context menu.

I've never used Sencha, so this is my crash course.

In the source of my project, all I see that page using is the JavaScript file "ext-all-rtl-debug.js".

I am guessing that is the runtime library (rtl) for the full ext class.

I made it to the documentation here:

http://docs.sencha.com/extjs/4.0.7/#!/api

But, I was not able to find anything about "rtl" or "all".

Could someone point me to where I'd need to look to see how to add/remove and wire-up context menu items? The control name would be a good start, but any other information that could boost me along my way would be great.

Thank you,

joel.watson
6 Nov 2015, 11:56 AM
Hi--

The tree panel has an event, "itemcontextmenu", for which you could add a listener:

http://docs.sencha.com/extjs/4.0.7/#!/api/Ext.tree.Panel-event-itemcontextmenu

In the handler for this event, you could create a menu, add items to it, and use the position from the event argument use when determining where to showAt() the menu:

http://docs.sencha.com/extjs/4.0.7/#!/api/Ext.menu.Menu-method-showAt

I hope that helps give you a good place to start--thanks!
Joel