Forum


10:09

18/03/2009

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
02:28

Moderators
30/10/2007

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.
04:22

18/03/2009

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.
08:20

Moderators
30/10/2007

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.
04:00

18/03/2009

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:29

Moderators
30/10/2007

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.
05:13

18/03/2009

Hello, let me show you some screenshots to describe better what I mean.
I have the following grid
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.
02:05

Moderators
30/10/2007

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.
Most Users Ever Online: 715
Currently Online:
58 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