Forum
Topic RSS
19:44
17/08/2011
OfflineBelow is a custom formatter I have for a cell to place two checkboxes in a cell.
function myFormatter(cellvalue,options,rowObject)
{
var regID="";
if (rowObject[0] == "undefined")
{
regID = rowObject.regID ;
}
else
{
regID = rowObject[0];
}
var approval = $('#grid').getLocalRow(options.rowId).approvalSelect;
return '<input type="checkbox" id="checkBoxYes_'+options.rowId+'" name="yes" value="'+ regID +'" ' + (approval=='Yes' ? 'checked="checked"' : '') + 'onclick="myFunctionYes(' + options.rowId + ')" />Yes '+
'<input type="checkbox" id="checkBoxNo_'+options.rowId+'" name="no" value="'+ regID +'" ' + (approval=='No' ? 'checked="checked"' : '') + 'onclick="myFunctionNo(' + options.rowId + ')" />No';
}
I have a button to set all checkboxes to Yes in the grid. I am looping through all of the records to set the cell value to Yes. It only seems to set the first page boxes to Yes but no of the other pages have the value checked. If I manually navigate to say page 2 and press the button then all of the cells are set to Yes.
function setAllToYes()
{
var count = $('#grid').getGridParam("records");
for (x=1; x<=count;x++)
{
var rowData = $('#grid').getRowData(x).approvalSelect;
$('#grid').updateGridRows({approvalSelect:'Yes'}, x, false);
$('#grid').setCell(x,'approvalSelect','Yes');
$('#checkBoxYes_' + x).attr('checked',true);
$('#checkBoxNo_' + x).attr('checked',false);
$('#grid').saveRow(x,false,'clientArray');
var rowData1 = $('#grid').getLocalRow(x).approvalSelect;
alert(x + " : " + rowData + " : " + rowData1);
}
Most Users Ever Online: 994
Currently Online:
11 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
Log In
Home