Forum


09:32

15/12/2010

Sorry my English is not good. Maybe somebody else had the same problem before, but I cannot find it in this forum as my reading speed is as slow as a snail.
Recently, I use jqgrid in my project. The jqgrid version is 3.8.1, and the jquery version is 1.4.4。I use Json to format the data,and i use Ajax to load the data. The browsers I used are firefox 3.6.13 and IE8.
The problem is, normally, the jqgrid shows a great performance. Everything works fine. The data shows like this:
Index name memo
1 lily test
2 lily2 test2
But, if I add a single quote to lily's memo, the grid shows like this:
Index name memo
In other words, no data can be seen as long as it contains single quote , only the table head left.
I tried to process json special charactors before put the data to jqgrid like this:
public static String jsonSpecialCharacters(String s) {
if (s == null || s.length() <= 0) {
return "";
}
String value = s.replaceAll("\", "\\\");
value = value.replaceAll("\'", "\\'");
value = value.replaceAll(""", "\"");
return value;
}
It doesn't works.
It is not a good idea that to simply discard single quotes.
So, how to deal with it? What can I do to show the single quotes in my grid ? Or is there anything I should do but I have ingored in my project?
Thanks a lot!
Most Users Ever Online: 715
Currently Online:
117 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