[英]How can I detect when a row is selected and non of rows is selected at jqgrid?
我的頁面上有一個禁用按鈕。 當我在網格中選擇一行時,我想啟用它。 如果未選擇任何行,則應返回禁用狀態。 ,
如何檢測何時選擇了行並且在jqgrid中選擇了非行?
如果使用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
中包含禁用按鈕的代碼,因為在開始時,在更改排序順序之后或在過濾之后(如果使用它),行將不會被選中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.