Forum


10:29

19/03/2009

Hi,
I've got a problem with my generic filter form... everything works fine by defining the editoptions (for select) as JSON array with "normal" alphanumeric characters. But when I use a ";" in one of my key-value-option-pairs then all will break.
The editoptions array is generated server-side (using PHP) and pushed into the Javascript jqGrid editoptions property. No htmlspecialchars, addslashes oder json_encode helped for the following data string:
SName. "§$%&/()=>?`´;.+*<^°
So how should I encode this in order to make it working with editoptions?
Thanks in advance.
02:59

Moderators
30/10/2007

Hello,
I sugest you in this case to use the another possibility - set this as object - i.e. we can have in editoptions this
editoptions:{value:{1:'one',2:'two'...}}
to represent the selects
Hope this will help
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.
03:26

19/03/2009

Thank you for your hint. I changed my PHP code to generate a JSON object instead of an array... this is what a sample result could look like:
{ value:
{ 'Pkey. "§$%&/()=>?`´;.+*<^°' :
'Pvalue. "§$%&/()=>?`´;.+*<^°'
}
}
Unfortunately I get an error stating...
elem is undefined
... using the Firebug javascript console. Does jqgrid support full object member names of type string? (as defined in RFC 4627)
03:26

Moderators
30/10/2007

Hello,
The key value should not be enclosed in ''
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.
03:42

19/03/2009

RFC 4627 defines that an object property must be encloded in ''… nevertheless I also tried this without the key value apostrophe but it didn't work either.
The problem is, that without any limiting ''-elements it's very difficult to transform every not allowed element into another representation. For the JSON object variant one will have to transform all '{' or '}' elements, ',' and ':' elements and so on. I'm not aware of a PHP transformation function that covers all these cases.
Greetings
- Marcel
Most Users Ever Online: 715
Currently Online:
53 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