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
editoptions and special characters
22/06/2009
10:29
Avatar
Marcel Karras
Member
Members
Forum Posts: 22
Member Since:
19/03/2009
sp_UserOfflineSmall Offline

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.

23/06/2009
02:59
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

23/06/2009
03:26
Avatar
Marcel Karras
Member
Members
Forum Posts: 22
Member Since:
19/03/2009
sp_UserOfflineSmall Offline

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:

editoptions example
{ value:
{ 'Pkey. &quot;§$%&amp;/()=&gt;?`´;.+*&lt;^°' :
'Pvalue. &quot;§$%&amp;/()=&gt;?`´;.+*&lt;^°'
}
}

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)

01/07/2009
06:20
Avatar
Marcel Karras
Member
Members
Forum Posts: 22
Member Since:
19/03/2009
sp_UserOfflineSmall Offline

A fresh code checkout didn't help for me either. :-/

02/07/2009
03:26
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

02/07/2009
03:42
Avatar
Marcel Karras
Member
Members
Forum Posts: 22
Member Since:
19/03/2009
sp_UserOfflineSmall Offline

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

Forum Timezone: Europe/Sofia

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

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information