locked
Use JSON objects to bind data on Windows 8 grid view using Javascript

    Question

  • Hi,

    I am trying to bind data from a JSON which is coming from windows azure service. I have a Group list page and an item list page. I want to bind different data to both these pages using the above JSON. Kindly help me how will i be able to do this using Javascript.

    Thanks in Advance :)


    Friday, April 26, 2013 7:59 AM

Answers

  • Hi,

    I hope you are using Xhr to make the call to receive JSON. if so, you can use JSON.parse and then you will get the objects. you can play around with the objects or just straight bind then to the lists.

    For example :

    WinJS.xhr({
                    type: "GET", url: <your url>
                }).then(
                                    function (xhr) {
                                        var dataObj = JSON.parse(xhr.response);
    //Do whatever you want with this dataObj
    );

    If you need help in specific issue please share the code and explain the issue that you are having.

    - Girija

    Tuesday, April 30, 2013 8:17 PM

All replies

  • Please give us much more information than this so we can help you.  We need to know what your desired output should be, what the JSON looks like, what objects you are trying to download, etc. 

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, April 26, 2013 7:03 PM
    Moderator
  • Hi,

    I hope you are using Xhr to make the call to receive JSON. if so, you can use JSON.parse and then you will get the objects. you can play around with the objects or just straight bind then to the lists.

    For example :

    WinJS.xhr({
                    type: "GET", url: <your url>
                }).then(
                                    function (xhr) {
                                        var dataObj = JSON.parse(xhr.response);
    //Do whatever you want with this dataObj
    );

    If you need help in specific issue please share the code and explain the issue that you are having.

    - Girija

    Tuesday, April 30, 2013 8:17 PM