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
make checkbox checked
30/03/2009
10:09
Avatar
thdim
Member
Members
Forum Posts: 6
Member Since:
18/03/2009
sp_UserOfflineSmall Offline

Hello,

I am trying  to make a checkbox that will have the tag checked by default.

that is my code

{name:'q1',index:'q1',width:37,align:'center',editable:true,edittype:”checkbox”,editoptions:{value:”Yes:No”}},

I am trying things like editoptions:{value:”Yes:No”, checked:”checked”} or checked:true, but nothing seems to work. I check the documentation very carefully and I couln't found something as well, any idea?

thanks

01/04/2009
02:28
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

What about your data. How is provided. What values do you have for checkboxes?

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.

01/05/2009
04:22
Avatar
thdim
Member
Members
Forum Posts: 6
Member Since:
18/03/2009
sp_UserOfflineSmall Offline

tony said:

Hello,

What about your data. How is provided. What values do you have for checkboxes?

Regards

Tony


Hello Tony, thanks for answering

In the javascript I have:

{name:'q1',index:'q1',width:37,align:'center',editable:true,

edittype:”checkbox”,editoptions:{value:”Yes:No”}},

the reult in HTML is:

<input id=”q1″ name=”q1″ value=”Yes”>

and I would like to make it (depentes on the database values offcource)

<input id=”q1″ name=”q1″ value=”Yes” checked>

any ideas? thanks a lot.

05/05/2009
08:20
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I mean the data from server or from the array that is populated in the grid.

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.

07/05/2009
04:00
Avatar
thdim
Member
Members
Forum Posts: 6
Member Since:
18/03/2009
sp_UserOfflineSmall Offline

I thing that I don't unterstaind what do you mean 🙁

In the database I store the value in a bool (0,1). I just want an example of that javascript rule witch will create the box checked and then I can make it act dynamic.

{name:'q1',index:'q1',width:37,align:'center',editable:true,edittype:"checkbox",

editoptions:{value:"Yes:No"}},

09/05/2009
09:29
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Haw look the response from the server - if the data is in xml post a part from the xml, if the data is on json post the json data  that comes from the server.

If you database return boolean 0,1 then you should

editoptions : {value:"1:0"}

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/05/2009
05:13
Avatar
thdim
Member
Members
Forum Posts: 6
Member Since:
18/03/2009
sp_UserOfflineSmall Offline

Hello, let me show you some screenshots to describe better what I mean.

I have the following grid

Image Enlarger

This is database / xml driven. At the end of every record I have some checkboxes, witch they define in witch quarter a project belongs.

So far, so good.

But when it comes to edit there is the following problem

[Image Can Not Be Found]

As you can see all the checkboxes are always empty. This is because when I define them I don't know how to say ("make this check box been checked by default"). For example when I define an input field I can do this in the javascript file

{name:'sector',index:'sector',width:50,editable:true,edittype:"select",editoptions:{value:"<?php echo $sector_options; ?>"}},

How can I set a checkbox to start by default checked?

{name:'q1',index:'q1',width:37,align:'center',editable:true,edittype:"checkbox",

editoptions:{value:"1:0"}},

p.s. I am almost sure that I use totally wrong way to succed what I want to do!

p.s.2 Really sorry, I know that I am starting to becoume really annoing, but I have to finish a project and I really don't have any idea how to do that!

p.s.3 thanks again and again and again.

15/05/2009
02:05
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

What I try to explain and undertand is what is the exact values from the DB that you send to the grid. With other words please put here the response from the server.

If your value from server that coresponds to the checkbox is 0 the checkbox is uncheced, if 1 checkbox will become checked.

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.

24/06/2009
10:15
Avatar
p_mendes
Member
Members
Forum Posts: 4
Member Since:
22/06/2009
sp_UserOfflineSmall Offline

Hi,

I came across with a simular issue. It was resolved adding the 'formatter:'checkbox'' option to the column array options in ColModel array. Now I can respond from server values like 'OK:NOK', 'Yes:No', '1:0', etc.

hope this helps.

Mendes

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
21 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