jQWidgets Forums

jQuery UI Widgets Forums Plugins Data Adapter Xml datasource – child elements with same name as in root.

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 3 months ago.

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

  • nobody0101
    Participant

    I am having an issue where in my xml data, I have child elements off the root that have the same element name as what is also found in the root.

    What then happens, is when I use the data in a jqxGrid I find the values of the other child elements of the same name off the root appended.

    For example my datafields looks like this (truncated):

    
    datafields : [ {name : 'insertDate', type: 'date'}, ... and so on 
    root: "Items",
    record: "Item"
    ...

    And my xml data looks like this (also truncated):

    <Items>
    <Item>
    <insertDate>12/12/2013</insertDate>
    <SubItem>
    <name>Some Name</name>
    <insertDate>01/01/2014</insertDate>
    </SubItem>... and so on with the SubItems
    </Item>
    </Items>

    In my column definition I have the following:

    {																	text : 'Insert Date',
    datafield : 'insertDate',
    ..
    }

    And in the display I get both all the insertDates appended together, instead of just the single item from the root that I wanted.

    Is there any way to map only to root, and not to include the children of the root?

    Thanks,


    Peter Stoev
    Keymaster

    Hi nobody0101,

    Unfortunately, such data cannot be processed and loaded by jqxDataAdapter into jqxGrid. I suppose that you will have to implement some custom loading through jQuery Ajax.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.