How can I unselect a row on click? I tried this:
beforeSelectRow: function(rowid, e) {
if ($(this).getGridParam('selrow') == rowid) {
return false;
} else {
return true;
}
}
But only selection works, if I click on a selected row it does nothing.
Instead of return false
try:
$("#myGrid").jqGrid("resetSelection");
So your code would be:
beforeSelectRow: function (rowid) {
if ($(this).jqGrid("getGridParam", "selrow") === rowid) {
$(this).jqGrid("resetSelection");
} else {
return true;
}
}
Try this
onSelectRow: function(id, rowid){
if(id && id!==lastsel3){
jQuery('#NAME_GRID').jqGrid('saveRow',lastsel3);
lastsel3=id;
}
},
please declare lastsel3 = null;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With