I want a image column in my jQGrid,I have used a formatter,but doesnot work,please give me the solution for this.
my code is as follows:
jQuery(document).ready(function() {
var TheGrid ;
var resp;
jQuery("#registerUsers").jqGrid({
url: 'EventsList.aspx',
datatype: "json",
colNames: ['Name', 'Company Name', 'Responsible Name', 'Date/Time', 'Id'],
colModel: [{ name: 'GuestName', index: 'GuestName', width: 150, editable: true, editoptions: {readonly: true, size: 10} },
{ name: 'CompName', index: 'CompName', width: 150, editable: false, editoptions: { readonly: true, size: 10} },
{ name: 'RespName', index: 'RespName', width: 150, editable: false, editoptions: { readonly: true, size: 10} },
{ name: 'RegisterDate', index: 'RegisterDate', width: 150, editable: false, editoptions: { readonly: true, size: 10} },
{ name: 'Register_Id', index: 'Register_Id', width: 100, align: 'left', formatter: checkboxFormatter },
],
rowNum: 10,
rowList: [10, 20, 30],
pager: jQuery('#Userpager'),
sortname: 'Register_Id',
viewrecords: true,
sortorder: "desc",
imgpath: '/scripts/themes/steel/images',
caption: "Registered Users"
});
});
jQuery("#registerUsers").jqGrid('navGrid', '#Userpager', { edit: false, add: false, del: false });
function checkboxFormatter(el, cval, opts) {
debugger;
cval = cval + ""; cval = cval.toLowerCase();
// var bchk = cval.search(/(false|0|no|off|n)/i) < 0 ? " checked=\"checked\"" : "";
var UserId = jQuery("#registerUsers").getCell(RowId, 'Register_Id');
$(el).html("<center><img src='../images/gnome-session-logout.png' width='15px' height='15px' onclick=javascript:LogOutUser(" + UserId + ");/></center>");
// <input type='checkbox' onclick=\"ajaxSave('" + opts.rowId + "', this);\" " + bchk + " value='" + cval + "' offval='no' />
}
Please help me
Thank You Ritz