EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: dies_felices on August 18, 2015, 06:37:46 AM



Title: Update Context Menu per row [Resolved]
Post by: dies_felices on August 18, 2015, 06:37:46 AM
Hi,

I'm trying to change the Text on a context menu depending upon which row you click on.  There seem to be two ways to achieve this, neither of which I am able to correctly run.

The first using the set text method on the menu:

     http://jsfiddle.net/3L4ej4dx/100/

As the menu items are created dynamically, I am unable to find them by name or id.


The alternative method is to destroy the original menu once it's been shown and create a new one each time the menu is triggered:

    http://jsfiddle.net/3L4ej4dx/99/

This throws an error

jquery.easyui.min.js:5453 Uncaught TypeError: Cannot read property 'options' of undefined


Any suggestions, ideas, insightful knowledgeable answers will all be gratefully received.  Thank you.


Title: Re: Update Context Menu per row
Post by: stworthy on August 18, 2015, 07:16:17 AM
Please try this example http://jsfiddle.net/3L4ej4dx/101/


Title: Re: Update Context Menu per row
Post by: dies_felices on August 18, 2015, 08:13:06 AM
Thank you, that has worked splendidly.  :)

Awesome!!!