Forum
04:03
24/07/2014
I have a Jqgrid with a Checkbox given in the header Section.
colNames: ['', '', '<input type="checkbox" id="chkmultiSelect" onclick="abc(event)"/>'],
colModel: [
{ name: 'ID', index: 'ID', hidden: true, key: true },
{ name: 'RI', index: 'RI', hidden: true },
{ name: 'Sel', index: 'Sel', edittype: "checkbox", search: false, width: 22,
formatter: function(cellvalue, options, rowObject) {
switch (cellvalue) {
case "Yes": return "<img src='../../Images/ChkChk.gif' alt='Yes' onclick='checkGridRow(" + options.rowId + ")' />";
break;
default: return "<img src='../../Images/ChkBlank.gif' alt='No' onclick='checkGridRow(" + options.rowId + ")' />";
break;
}
}, unformat: imageUnFormat
}]
----------------------
This is the scenario
Initally when Page Loading all the columns will be coming with out check box. When i clicked the chkmultiselect i want to mark checked in my columns. ie Update with another tag  "<img src='../../Images/ChkChk.gif' alt='Yes' onclick='checkGridRow(" + options.rowId + ")' />"
Â
My abc Event: I want to update my "Sel" column with chkchk image.
function abc(e) {
e = e || event; /* get IE event ( not passed ) */
e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
var mydata = $("#list").jqGrid('getGridParam', 'data');
var gridId = jQuery("#list").getDataIDs();
//loop through grid rows
for (var countRow = 1; countRow <= gridId.length; countRow++) {
var rowId = gridId[countRow];
var beChecked = "<img src='../../Images/ChkChk.gif' alt='Yes' onclick='checkGridRow(" + rowId + ")' />";
var inputControl = beChecked;
jQuery("#list").jqGrid('setRowData', rowId, {Sel: "<img src='../../Images/ChkChk.gif' alt='Yes' onclick='checkGridRow(" + rowId + ")' />" });
}
if ($('#chkmultiSelect').is(':checked')) {
$('#chkmultiSelect').prop('checked', true);
}
else {
$('#chkmultiSelect').prop('checked', false);
}
}
Â
I am getting my chkmultiselect functioning correctly. but the grid column sel is not updating.
This is very urgent for me.. Any guesses why?
Â
ThanksDGS
Most Users Ever Online: 715
Currently Online:
51 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