Hi,
is there JSON support in Scripycase?
In other word how can i present data from a JSON formatted field into normal field layout?
Regards
Erwin
Hi,
is there JSON support in Scripycase?
In other word how can i present data from a JSON formatted field into normal field layout?
Regards
Erwin
Just plain php, it has everything you need.
http://php.net/manual/en/function.json-decode.php
i.e.
$string = ā{āfirstnameā: āJohnā, ālastnameā: āDoeā}ā; //thatās your JSON string
$myarray = json_decode($string, true); //create an associative array
{first_name} = $myarray[āfirstnameā];
{last_name} = $myarray[ālastnameā];
Thatās it.
jsb
Thank you, and how can i prsent this in a gridview?
Sorry, iām rather new to scriptcase.
[QUOTE=etsoft;31804]Thank you, and how can i prsent this in a gridview?
Sorry, iām rather new to scriptcase.[/QUOTE]
You canāt. Grids feeds from database.
[QUOTE=etsoft;31804]Thank you, and how can i prsent this in a gridview?
Sorry, iām rather new to scriptcase.[/QUOTE]
Create a table according to your json data and base a grid on it.
Load the array into the table.
Voila!
jsb
PS: Damn Giu, 3 minutes. :-o
Still, if there are more users this solution is too simple. You need to create a temporary table and/or use some info to match the user.
[QUOTE=jsbinca;31807]Create a table according to your json data and base a grid on it.
Load the array into the table.
Voila!
jsb
PS: Damn Giu, 3 minutes. :-o[/QUOTE]
Well, your answer is more complete
[QUOTE=jsbinca;31807]Create a table according to your json data and base a grid on it.
Load the array into the table.
Voila!
jsb
PS: Damn Giu, 3 minutes. :-o[/QUOTE]
so shall we parse our Json string and insert to a mysql table and use the table in grid application?
Yes. AS I mentioned Grid apps feeds from an SQL. For this reason if you receive this data on JSON format, you need to pass it to a table, and feed grid from there.
Can we get a grid that loads json arrays like Kendo grid does ?