I require a context menu for jqgrid that can dynamically prepare context menu items (from scratch) based on selected row. Is there any solution for this? currently I am binding context menu to the jqgrid at the time of jqgrid initialization, but now I want it to be bind dynamically based on selected row.
Asked
Active
Viewed 179 times
0
-
There are many ways to implement dynamic context menu. Look at [the old answer](https://stackoverflow.com/a/34611089/315935) fore example, which uses [jQuery-contextMenu](http://swisnl.github.io/jQuery-contextMenu/) plugin. There are many other alternative solutions. The choice could depend on CSS framework, which you use, on the version and fork of jqGrid, which you use. – Oleg Jun 22 '18 at 06:51
-
I want to make it with jqgrid. do you have any idea? – murtaza sanjeliwala Jun 22 '18 at 08:57
-
I don't understand what you mean. jqGrid has no internal built-in context menus, but one can bind the standard `context` event on the whole grid or on every row. There are many existing plugins, which can be used *in combination* with jqGrid. The answer, which I referenced in my previous comment provides the corresponding demo. Is it what you need? – Oleg Jun 22 '18 at 09:05
-
I visited the link you have provided. It is very useful thanks. – murtaza sanjeliwala Jun 22 '18 at 10:16
-
You are welcome! I'll post the summary of the information from above comments as the answer. – Oleg Jun 22 '18 at 10:17
1 Answers
1
jqGrid has no internal built-in context menus, but one can bind the standard context event on the whole grid or on every row. There are many existing plugins, which can be used in combination with jqGrid. The old answer provides an example of using jQuery-contextMenu plugin in combination with free jqGrid. I think that you can use close code to implement your requirements.

Oleg
- 220,925
- 34
- 403
- 798