JSON dhtmlX + Struts2

I have to developed struts 2 application.
I have one Action class which has map a string variable
I don´t know inicialization my grip with a json with my variable.

This code is ok: :smiley:

var js={
{ id:1001,
“A Time to Kill”,
“John Grisham”,
“05/01/1998”] },
{ id:1002,
“Blood and Smoke”,
“Stephen King”,
“01/01/2000”] }

In my jsp I capture the variable return by my Action
<s:hidden id=“cadena” value="%{JsonResult}"/>

..... var cadena= document.getElementById("cadena").value; alert(cadena) ;// display String with json format.is OK. ...... grid.parse(cadena,"Json"); // ERROR This code has syntax error. I think the error is produced by String conversion to JSON. :angry: PLEASED HELPME!

grid.parse expects to receive the json object, not the string.
you can change your code as

var cadena= document.getElementById("cadena").value; eval("cadena="+cadena+";"); grid.parse(cadena,"Json"); // ERROR