jQWidgets Forums

jQuery UI Widgets Forums Grid Nested Grid using single JSON datasource

Tagged: ,

This topic contains 2 replies, has 1 voice, and was last updated by  areel 11 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • areel
    Participant

    Hi

    I am completely new to this framework and just started to evaluate it.
    I am looking for some pointers (outline or link to example) to how to define a grid to display parent-child / nested rows from a single json datasource.
    That is, each parent row has a property that references an array that contains the child details.

    I have a grid displaying (grouping/sorting etc) the parent rows, just need to add support for showing the child detail.
    Impressed with the speed so far, I have evaluated other products in this area and I am very impressed with the performance.

    Regards

    Aidan


    areel
    Participant

    Hi

    I have been using this

    http://www.jqwidgets.com/community/topic/related-to-parent-child-jqxgrid/

    as my sample and modified it. Since the initrowdetails function has the following signature:
    function (index, parentElement, gridElement, record)

    I thought a reasonable approach would be to access the details via the record passed in so I added that property to
    source.datafields.

    var source = { localdata: $scope.data,
    datafields: [ { name: ‘id’, type: ‘string’ }, ….. { name: ‘details’, type: ‘array’}], ….. }

    var dataAdapter = new $.jqx.dataAdapter(source, {
    loadComplete: function (data) { },
    loadError: function (xhr, status, error) { }
    });

    However the record parameter in initrowdetails contains the detail property but it’s value is a string,

    details: “[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]”

    rather then an array.

    So question becomes how can I pass the details array from the parent row into the initrowdetails function.

    Regards

    Aidan


    areel
    Participant

    Feels like a monologue …..

    I have found out that if you do NOT define the datafields within your source definition, then the details property comes through as an Array rather then a string.

    Is this the expected behaviour?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.