Forum
05:05
02/01/2009
A column is formatted to be a checkbox --> formatter: 'checkbox'
the line:
var APR = $('#ETSMonth').getCell(id, 3);
returns:
<INPUT disabled type=checkbox CHECKED value=-1 offval="no">
Ideally it should return (true or false) or (-1 or 0) weather the column is hidden or not.
Is it possible to disable the ability to edit a cell based on the status of this checkbox column for individual rows?
Thanks in advance,
Rob..
06:36
Moderators
30/10/2007
Hello,
I will make an appeal for this
Please read first the forum for this.
Also again - getCell and getRowData are not compatible when they are applied to curretly edited elements.
Best 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.
19:13
02/01/2009
Not exactly sure what you mean by incompatible or currently edited elements.
The checkbox column is not being edited when its value is extracted using
var APR = $('#ETSMonth').getCell(id, 3);
In any case, I've checked other cells, some editable and some not, some hidden and some not using getCell at the same place in code an only the checkbox cell does not return the value as indicated above.
Can you see something wrong with the colModel: property setting for this column?
{label: 'APR', name: 'APR', index: 'Approved', width: 35, formatter: 'checkbox', align: 'center' },
Is there an alternate way of getting the content of a checkbox?
09:54
Moderators
30/10/2007
Hello,
Right now I understand what you mean 🙂
When you use the formater the possible values returned from the server (or array) can be true/false, yes/no, 1/0, on/off - I see you use -1 which will retun unexpected results. Also a good idea in this case is (not documented - sorry) to set a editoptions values for the checkbox instead that they is not editable.
Maybe I need to change the unformat function (wich is used in getCell) for checkbox the same way as for formatter.
Thank you.
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.
10:44
02/01/2009
Hi Tony,
the json text data for this cell is “True” or “False”
By “editoptions values for the checkbox instead that they is not editable” do you mean:
{label: 'APR', name: 'APR', index: 'Approved', width: 35, formatter: 'checkbox', editoptions align: 'center' , editoptions:{value:{1:'True',2:'False'}}},
without editable: true
That did not work.
the APR cell still returns “<INPUT disabled type=checkbox CHECKED value=-1 offval=”no”>” using getCell
Also tried:
{label: 'APR', name: 'APR', index: 'Approved', width: 35, edittype: "checkbox", formatter: 'checkbox', align: 'center', editoptions: { value: "Yes:No"} },
And
{label: 'APR', name: 'APR', index: 'Approved', width: 35, formatter: 'checkbox', align: 'center', editoptions: { value: "Yes:No"} },
RobGMiller…
11:15
Moderators
30/10/2007
Hello,
editoptions: { value: "True:False"} ...
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:41
02/01/2009
The following did not work either even though the JSON data for this field is "True" or "False":
{label: 'APR', name: 'APR', index: 'Approved', width: 35, formatter: 'checkbox', editoptions: { value: "True:False"}, align: 'center' }
when the formatter:'checkbox' option is set then the only return I can get is
<INPUT disabled type=checkbox CHECKED value=-1 offval=”no”>
If the formatter:'checkbox' option is not present then the return value is "True", "False", "Yes" or "No" whatever is contained for the json text data for this field.
I suppose I can parse that result to extract the value but I will probably go without the formattter: 'checkbox' configuration and live with the word "Yes" or "No" in the column for now.
RobGMiller...
05:06
Moderators
30/10/2007
Hello,
Thank you. I will definitley check this.
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.
Most Users Ever Online: 715
Currently Online:
55 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