jquery - Adding functions into existing JqGrid events -


so application uses multiple grids, separated codes 2 files, 1 unique grid, , 1 more common functions shared across grids.

now thing is, defined of events in unique files, example, defined loadcomplete event in 1 of grid file because functions unique grid , not other grids. when tried add common loadcomplete functions apply grids in common functions file, wouldn't work me.

i can make work if defined common functions in every loadcomplete defeat purpose of separating unique-to-the-grid functions in 1 file , shared functions in file (for maintaining purpose).

so i'd know there way add functions in loadcomplete event in common functions file, when loadcomplete event has been applied in every file unique grid itself.

i tried following examples got here none seems work me

$.jqgrid.extend({})  $(function() {})  (function($){})  jquery.extend(jquery.jgrid.defaults, {}) 

if read of answers see use little other terminology official jqgrid documentation. name loadcomplete callback function instead of event handler. 1 can define only once callback function loadcomplete. on other side 1 can use jquery events jqgridloadcomplete (see here) introduced in version 4.3.2 of jqgrid. way corresponding modification of jqgrid code made me. posted many pull requests events.

you can find fragment of usage jqgridloadcomplete event in the answer. way can bind event jqgridloadcomplete empty <table> element before grid created. if sure jqgridloadcomplete fired initial filling of grid.

the main advandage of usage jquery events jqgridloadcomplete: 1 can define multiple event handles. can implement scenario need. way there exist jqgridafterloadcomplete event too. first fired jqgridloadcomplete event , event handlers executed, called loadcomplete callback , jqgridafterloadcomplete event fired. should decide 1 (jqgridloadcomplete or jqgridafterloadcomplete) better scenario implement.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -