Dynamic Context Menu for a Grid?
Posted: Tue Oct 01, 2019 5:54 pm
I'm trying to customize the options for a context menu depending on field values for a grid row. I'm having challenges doing this. For example, lets say I have a grid with sales orders with a status column (Open or Closed). For open sales orders, the context menu could be "View, Change, Close". For closed sales orders, the context menu could be "View, Archive".
I have tried creating a grid context menu and binding the options to a row field in the grid, but that's not working due to the row suffix (gridRow.1, gridRow.2, etc).
I've also tried creating a custom context menu (https://blog.profoundlogic.com/profound ... text-menus) with hidden fields in the grid rows containing the options & values for that row, but I can't figure out how to dynamically assign the menu options by the browser when the row is clicked. I do not want to use pui.click to have the server determine the options based on which row was clicked.
I am using an 18 row page-at-a-time grid, so I suppose I could create 18 menu elements where each menu is bound to one row's options & values field, but I'd really rather try something a little less clunky. Any suggestions?
I have tried creating a grid context menu and binding the options to a row field in the grid, but that's not working due to the row suffix (gridRow.1, gridRow.2, etc).
I've also tried creating a custom context menu (https://blog.profoundlogic.com/profound ... text-menus) with hidden fields in the grid rows containing the options & values for that row, but I can't figure out how to dynamically assign the menu options by the browser when the row is clicked. I do not want to use pui.click to have the server determine the options based on which row was clicked.
I am using an 18 row page-at-a-time grid, so I suppose I could create 18 menu elements where each menu is bound to one row's options & values field, but I'd really rather try something a little less clunky. Any suggestions?