Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
985
igListView: How to bind jason array data to data-item-template
posted

I have json data array (shown below) and would like to display in Mobile ist View Control, something like this:

  data-item-template="<div>  <span> array element 1</span> <span>array element 2 </span> </div>"

 

Note: I have simplified to understand problem, data displayed is very complex and around 50 array elements.

Json Data:

{

    "browseData": [

        [

            "10S10010",

            "10C1000",

            "Z"

        ],

        [

            "SO011203",

            "10C1000",

            "A"

        ]

    ]

}

Parents
No Data
Reply
  • 49378
    posted

    Hi annasaheb,

    Thank you for posting in the community.

    I have researched this scenario and it seems that in this scenario the json properties should not contain arrays as it would not be possible to access their respective items (as templating counts on property access). More on accessing properties can be found at:

    http://help.infragistics.com/NetAdvantage/jQuery/2012.1/CLR4.0?page=igListView_Adding_igListView_to_a_Web_Page.html

    var source = [{parent : [ "1", "2"]}]

    would become

    var source = [

        {"parent":"1"},

        {"parent":"2"}

    ]

    Afterwards this would be displayable in your template using something like:

     data-item-template="<div>  <span> ${parent} </span> <span> </span> </div>" 

     Please feel free to contact me if you have any questions.

Children