Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
440
Dynamic RowContextMenu
posted

Hi,

I'd like to be able to build my RowContextMenu at run-time based on the row being selected. Based on values in the selected row, I need to be able to modify my row context menu and JS calls to it.

How can I achieve this?

Thanks!

  • 13438
    posted

    Hello Khaled,

    If you like you can set autopostback flags to true on RowSelection Change. This way everytime you go to the server you will be able to clear the items from the menu and add new one. What I would suggest to use only javascript and add all the necessary items in the context menu. Then on popping of the menu to disable or make invisible those items which should not be available like ContextMenu.getItems().getItem(0).set_visible(true)  or ContextMenu.getItems().getItem(0).set_enabled(true) .

    Please let me know if those suggestions sound reasonably to you and if you face any issues implementing them.