Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
How to get value of checkbox.
29/01/2009
05:05
Avatar
RobGMiller
Member
Members
Forum Posts: 42
Member Since:
02/01/2009
sp_UserOfflineSmall Offline

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..

29/01/2009
06:36
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

29/01/2009
19:13
Avatar
RobGMiller
Member
Members
Forum Posts: 42
Member Since:
02/01/2009
sp_UserOfflineSmall Offline

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?

30/01/2009
09:54
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

30/01/2009
10:44
Avatar
RobGMiller
Member
Members
Forum Posts: 42
Member Since:
02/01/2009
sp_UserOfflineSmall Offline

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…

30/01/2009
11:15
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

30/01/2009
12:41
Avatar
RobGMiller
Member
Members
Forum Posts: 42
Member Since:
02/01/2009
sp_UserOfflineSmall Offline

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...

31/01/2009
05:06
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
16 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information