2016-11-18 50 views

回答

0

我想你執行的代碼之前創建的網格一些錯誤。你應該把代碼移到正確的地方。見https://jsfiddle.net/3304edu4/,它採用

$($("#grid")[0].grid.hDiv) 
    .find("th.ui-th-column") 
    .off("mouseenter mouseleave"); 

順便說一句,你可以移動代碼onInitGrid回調,這將電網(例如列標題)的外側部分後調用內部創建:

onInitGrid: function() { 
    $(this.grid.hDiv) 
     .find(".ui-jqgrid-labels th.ui-th-column") 
     .off("mouseenter mouseleave"); 
} 

請參閱https://jsfiddle.net/3304edu4/1/