Forum


16:42

09/11/2009

A php script buids a list and the grid uses it like this:
var items= $.ajax(
{
url:'listofitems.php',
async:false
}).responseText;
The returned string has this structure:
"item1:item1;item2:item2;…itemn:itemn"
The column is defined like this:
{
name:'reference',
index:'reference',
edittype:'select',
editoptions:{value:items},
editable:true
},
When the edit form is displayed I would like to see, for example, the odd items in red, the other ones in blue.
1) is it possible to "integrate" the color or the criteria in my script ?
2) and test in beforeshowform
Another solution is welcomed …
13:31

Moderators
30/10/2007

Hello,
This is not tested, but you can try to build the string like:
"item1:<font color='red'>item1</font>;item2:<font color='green'>item1</font>…."
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.
13:48

Moderators
30/10/2007

Hello,
The clear way IMHO (which work for me) is as follow:
Obtain your select via dataUrl option - the select can be something like this
<select id="s1">
<option class="red" value="1">2</option>
<option class="blue" value="4">3</option>
<option class="green" value="5">4</option>
</select>
Then define in the css:
<style>
option.blue { color: blue;}
option.green {color: green;}
option.red {color: red;}
</style
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:
63 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