EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: frankgao on October 06, 2015, 03:06:28 AM



Title: datagrid can't show illegal character.
Post by: frankgao on October 06, 2015, 03:06:28 AM
Hi,
There can't display data with the datagrid when json data include illegal character.
How can realize display illegal character in some special needs.


Code:
{"total":1,"rows":[{"logid":"97033","contents":"\0","ip":"127.0.0.1","builddate":"2015-10-06 17:51:34","emname_st":"abc","sysfunname_cn":""}]}


Title: Re: datagrid can't show illegal character.
Post by: rezzonico on October 06, 2015, 12:04:18 PM
Did you tryed with the formatter function ?


Title: Re: datagrid can't show illegal character.
Post by: frankgao on October 06, 2015, 05:09:30 PM
Did you tryed with the formatter function ?

Thanks.
I format the field value in sql query statement,but I found so many illegal character.
So I want to know is there have some component embed in datagrid can display like html,json,key word data?


Title: Re: datagrid can't show illegal character.
Post by: rezzonico on October 07, 2015, 01:12:28 AM
I found with google that '\0' is not allowed in json string.

I wrote a small example:
if I force in the json string the character '\0' the datagrid is not populated,
but if I create the json string on server side with the "to_json" function (in my case I use perl) the character '\0' is translated to '\u0000' and the datagrid is displayed correctly.

How do you create the json string on server side and which other special characters are not displayed correctly ?

Regards.
Miche