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
1145
Selecting the row by right clicking
posted

Hi 

I have added a context menu to a grid using the ui-context menu plugin as mentioned in this post.

I have used the following code in it's beforeOpen: handler to highlight the row

beforeOpen: function(event, ui) {
// find the row and select it to give user visual clue which row context menu is for
var rowIndex = $(ui.target).closest('tr').index();
$(gridElement).igGridSelection('selectRow', rowIndex);

},

However, this isnt always correct, if I expand a row (in a hierarchical grid) and right click below the expanded row, the indexing is off by 1. Right Clicking above teh expanded row still works. If I collapse the row, the issue remains.

So I am hoping that there is a more robust way of identifying the row that what I am currently using.

Regards

Aidan