Announcement

Collapse
No announcement yet.

JSON support?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • JSON support?

    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

  • #2
    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

    Comment


    • #3
      Thank you, and how can i prsent this in a gridview?
      Sorry, i'm rather new to scriptcase.

      Comment


      • #4
        Originally posted by etsoft View Post
        Thank you, and how can i prsent this in a gridview?
        Sorry, i'm rather new to scriptcase.
        You can't. Grids feeds from database.
        /Giuseppe

        Professional Scriptcase Services
        Some Customers opinions

        Comment


        • #5
          Originally posted by etsoft View Post
          Thank you, and how can i prsent this in a gridview?
          Sorry, i'm rather new to scriptcase.
          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
          Last edited by jsbinca; 01-28-2015, 05:42 PM.

          Comment


          • #6
            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.
            Albert Drent
            aducom software netherlands
            scriptcase partner, reseller, support and (turn-key) development
            www.scriptcase.eu / www.scriptcase.nl

            Comment


            • #7
              Originally posted by jsbinca View Post
              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
              Well, your answer is more complete
              /Giuseppe

              Professional Scriptcase Services
              Some Customers opinions

              Comment


              • #8
                Originally posted by jsbinca View Post
                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
                so shall we parse our Json string and insert to a mysql table and use the table in grid application?

                Comment


                • #9
                  Originally posted by sekr View Post
                  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.
                  /Giuseppe

                  Professional Scriptcase Services
                  Some Customers opinions

                  Comment

                  Working...
                  X