Forum


16:58

03/03/2010

I think I need to explain in more detail: below is my jqgrid
jQuery(document).ready(function() {
jQuery("#list").jqGrid({
url: '<%=Url.Action("", "") %>',
datatype: 'json',
mtype: 'POST',
colNames: ['IdNr', 'Agency Num', 'Clear', 'N/C Code', 'Description', 'Date Cleared',"Modify Flag"],
colModel: [
{ name: 'AGN_NUM', index: 'AGN_NUM', editable: false, hidden:true},
{ name: 'AGN_NUM', index: 'AGN_NUM', editable: false, hidden:true},
{ name: 'clr_flag', index: 'clr_flag', width: 60, align: 'center', editable: true, edittype:"checkbox", editoptions:{value:'1:0'}, formatter:"checkbox", formatoptions:{disabled:false},sortable:false},
{ name: 'NON_CMPL_CD', index: 'NON_CMPL_CD', width: 75, align: 'left', editable: false },
{ name: 'NON_CMPL_DESC', index: 'NON_CMPL_DESC', width: 250, align: 'left', editable: false},
{ name: 'DATE_CLR', index: 'DATE_CLR', width: 80, align: 'left', editable: false},
{ name: 'MODIFY_ROW_FLAG', index: 'MODIFY_ROW_FLAG', editable: false, hidden:true}
],
pager: '',
rowNum: -1,
rowList: [5, 10, 20, 50],
sortname: 'AGN_FY',
sortorder: 'asc',
altRows: true,
emptyrecords: "Nothing to display",
viewrecords: true,
imgpath: '<%=Url.Content("~/scripts/themes/basic/images")%>',
caption: '',
cellEdit: true,
cellsubmit: 'clientArray',
height: 275,
gridview: true
}).navGrid(pager, { edit: false, add: false, del: false, refresh: true, search: false }, { navkeys: [true, 38, 40] }, {}, { url: "/Mileage/Delete" });
});
I want to disable the checkbox on the grid load based on value hidden column (MODIFY_ROW_FLAG)value (Y/N) if possible.
if it is not possible on grid load then any other way , please advise
04:25

12/02/2010

Ok there's a dataEvents option you can you use on MODIFY_RAW_FLAG column here's mine just a sample:
dataEvents: [
{ type: 'change',fn: function(e) {
var ccode = $('#MODIFY_RAW_FLAG').val();
if ( ccode == "Y" ) {
alert(ccode);
$('#tr_clr_flag').attr('disabled',true);
}
if ( ccode == "N" )
{
alert(ccode);
$('#tr_clr_flag').attr('disabled',false);
}
} } ]
Above code is untested, you might need to tweak a bit to your liking and true/false might need to be change to disable,enable or something, alert was there just to make sure the events are being fired.
hth,
lupin
Most Users Ever Online: 715
Currently Online:
159 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66