2011-11-02 74 views

回答

2

如果使用multiselect: true选项,你应该做到以下几点

onSelectRow: function (id) { 
    var selRows = $(this).jqGrid('getGridParam','selarrrow'); 
    if (selRows.length === 0) { 
     alert ("no rows are selected now"); 
     // you can disable the button 
    } else { 
     alert ("a row is selected now"); 
     // you can disable the button 
    } 
} 

另外,你应该在loadComplete包括因为在开始禁用按钮的代码,更改排序顺序后或过滤后(如果你使用它)行将不会被选中。

相关问题