View Full Version : How to determine which menu item I'm working with in changeHandler?

23 Apr 2014, 9:59 AM
When a menu item is selected and my changeHandler is invoked (function(cycleBtn, activeItem)), what extjs mechanism is recommended to be used to determine which item I'm working with? Using the text of the item is not ideal as it may change. Other frameworks often provide a value attribute which may differ from the actual text displayed which can be relied on to accurately determine which item you're working with. Does ExtJs have a property I can reference on the selected menu item to accurately ascertain which item I'm working with to act upon? Obviously, I'd set this in advance too.

29 Apr 2014, 4:55 AM
You can use itemId or a custom property to signify something in your code.

29 Apr 2014, 8:47 AM
Yep, I had went with a custom 'value' property, but did see the itemId. I just wasn't sure if that was the original intention of the itemId property. Now I know. Thanks!