//Add a custom button to Grid, and give it an id, an example here is 'save1'
jQuery("#grid1").jqGrid('navGrid',"#pager1", {edit:false,add:false,del:false})
.navButtonAdd('#pager1',{
caption:"Save",
buttonicon:"ui-icon-disk",
position:"last",
id: "save1",
onClickButton: function(){
...
}
});
//Construct the onSelectRow event of the grid
jQuery("#grid1").jqGrid({
...
onSelectRow: function(rowid){
if (rowid==2) {
$("#save1").removeClass('ui-state-disabled'); //Enable
} else {
$("#save1").addClass('ui-state-disabled'); //Disable
}
},
...
});
No comments:
Post a Comment