JqGrid dynamic event

Suppose I have the following (short for simplicity):

jQuery("#grid").jqGrid({ ... ondblClickRow: function() { // I want to define this function dynamically at run time } ... }); 

How to bind the ondblClickRow event outside the Slow grid. For example, in jQuery I usually did

 $('#grid').bind('ondblClickRow', function() { alert('my over written event'); }); 
+4
source share
2 answers

You can override event handlers with setGridParam

Something like that:

 jQuery("#grid").jqGrid('setGridParam',{ ondblClickRow: function() { alert('my over written event'); } }); 

See docs: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods

+6
source

Have you ever successfully used setGridParam for the subGridRowExpanded event?

JqGrid's setGridParam method for subGridRowExpanded event throws an error

0
source

Source: https://habr.com/ru/post/1305424/


All Articles