tonytomov / jqGrid

jQuery grid plugin
www.trirand.com
2.84k stars 1.2k forks source link

getting master table information when detail table opens #977

Closed edwardsmarkf closed 3 years ago

edwardsmarkf commented 3 years ago

hello -

is there any sort of "hook" to somehow get the master row information when it is selected? i looked for "onSelectRow()" but i was not sure if that is the mechanism being used.

http://www.guriddo.net/demo/guriddojs/selection/master_detail/index.html

or perhaps some way to intercept the value being passed in:

jQuery("#detail").jqGrid('setGridParam',{postData:{CustomerID:rowid}});

EDIT: this apparently holds the key: jQuery("#MYTABLE").jqGrid('getGridParam', 'selrow') - is there somewhere i can determine what the row data looks like?

EDIT(2): this looks very promising:
document.getElementById(jQuery("#MYTABLE").jqGrid('getGridParam', 'selrow')).childNodes[0].title

EDIT(3): i had hoped something like this might work, but no success so far:

jQuery("#myGrid").jqGrid({
   onSelectRow: function(id){ 
       console.log(id);
   },

from: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:events

edwardsmarkf commented 3 years ago

got it....

$("#myTable").bind("jqGridAddEditBeforeShowForm", (a, b ) => { alert (a); } )