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
The table is empty when the data contains single quote
15/12/2010
09:32
Avatar
flowerfires
New Member
Members
Forum Posts: 1
Member Since:
15/12/2010
sp_UserOfflineSmall Offline

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!

 

14/04/2011
02:03
Avatar
machetico
New Member
Members
Forum Posts: 2
Member Since:
20/04/2010
sp_UserOfflineSmall Offline

Have you found a solution? I am facing the same problem

16/04/2011
14:30
Avatar
mascott
Member
Members
Forum Posts: 19
Member Since:
15/04/2011
sp_UserOfflineSmall Offline

I've got any single or double quotes in my data without any problems with the view.

Check if Json is valid.

Forum Timezone: Europe/Sofia

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

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information