Forum


11:11

Moderators
30/10/2007

Hello,
Do not understand. You have already setup a checkbox using formatter and try to edit a cell or ...
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
13:16

23/01/2010

I'm using Cell Edit mode...
I have a column with: edittype:checkbox, formatter:checkbox
The check box shows up okay. Since I'm in "cell edit" mode, I must click the cell to be able to edit it. I should be able to click anywhere in the cell to start editing.
However, I can not click where the check box is showing. I can only click in the space beside the check box.
In the documentation and samples, there are none that have a checkbox and use cell edit mode, so this problem is not seen in the samples.
Does that make sense?
16:32

Moderators
30/10/2007

Hello,
I see where is the reason for this. Yes - it will only work this way. If we "fix" this we will go to other big problems.
Sorry.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
16:40

Moderators
30/10/2007

Hello again,
Instead of the previous post I think that this can be achieved using beforeSelectRow event.
The idea is to determine that this checkbox is clicked and apply then editCell manually to this grid cell.
Will see how to help you later.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
12:38

11/02/2010

Reported this as a bug some time ago: http://www.trirand.com/blog/?p.....38;ret=all
Solved it using a custom formatter:
{
cellValue = cellValue + '';
cellValue = cellValue.toLowerCase();
var checked = cellValue.search(/(false|0|no|off|n)/i) < 0 ? ' checked="checked"': '';
var inputControl = '<input id="'+ options.rowId + options.colModel.name +'" class="view" type="checkbox" ' + checked + ' value="' + cellValue + '" onclick="MakeCellEditable('+options.rowId+',''+options.colModel.name+'')" />'
return inputControl;
}
{
var rowids = $('#grid').getDataIDs();
var colModel = $('#grid').getGridParam().colModel;
for (var i = 0; i < rowids.length; i++)
{
if(rowId == rowids[i])
{
for (var j = 0; j < colModel.length; j++)
{
if (colModel[j].name == colName)
{
// Put cell in editmode.
// If the edit (third param) is set to false the cell is just selected and not edited.
// If set to true the cell is selected and edited.
jQuery("#grid").editCell(i,j,true);
// Let the grid know that the cell has been changed without having to push enter button or click another cell.
jQuery("#grid").saveCell(i,j);
}
}
}
}
}
12:20

14/01/2011

Thanks for this.
There is a typo in boolformatter, here is corrected
{
cellValue = cellValue + '';
cellValue = cellValue.toLowerCase();
var checked = cellValue.search(/(false|0|no|off|n)/i) < 0 ? ' checked="checked"': '';
var inputControl = '<input id="'+ options.rowId + options.colModel.name +'" class="view" type="checkbox" ' + checked + ' value="' + cellValue + '" onclick="MakeCellEditable('+options.rowId+',"'+options.colModel.name+'")" />';
return inputControl;
}
I have one issue though: In display, it shows as 0 or 1 instead of a checkbox. Only If I click on it, I do get the checkbox. Any tips? Here is how I am using it:
Most Users Ever Online: 715
Currently Online:
57 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