Is it possible to bind multiple event handlers to JqGrid events without overwriting previous ones?

前端 未结 4 2041
旧巷少年郎
旧巷少年郎 2020-11-29 10:40

For example, I call my default settings on every page load and bind a function to loadComplete to do some basic formatting for my grids.

On some pages, I have additi

4条回答
  •  执念已碎
    2020-11-29 11:16

    There is a much easier solution to this than I have seen recommended anywhere else:

    // Set defaults
    jQuery.extend(jQuery.jgrid.defaults, {
        loadComplete: function () {
            myCustomFunction();
        }
    });
    
    loadComplete: function() {
        // someOtherFunction();
        $.jgrid.defaults.loadComplete(); // Runs myCustomFunction()
    },
    

提交回复
热议问题