jQWidgets Forums

jQuery UI Widgets Forums Grid Nested XML binding

This topic contains 2 replies, has 2 voices, and was last updated by  Hristo 8 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Nested XML binding #87961

    engineering87
    Participant

    Hi all,
    need to bind a complex XML to jqxGrid. The XML example is:

    <A>
    	<B id="1">
    		<code>26391</code>
    		<M>
    			<D name="example">
    				<E>
    					<F name="1">1</F>
    					<F name="2">2</F>
    				</E>
    			</D>
                            <D ... />
                    </M>
                    <M ... />
    	</B>
            <B ... />
    </A>

    D is a column group.
    I can correct bind the B code and the columns group but can’t bind correct the F multiple node.
    If I use this map on datafield internal to the columns group

    “map”: ‘>M>D>E>F’,

    I obtain the value 1,2 in both subcolumn.

    Any help is highly appreciated.

    Thank you

    Nested XML binding #87967

    engineering87
    Participant

    Adding some details.
    The grid is dynamic so I iterate the D nodes and add a column foreach F and related to the D column group.
    But when I try to map the F node like

    “map”: ‘>M>D>E>F[name=x]’

    where x is current F name node, it doesn’t work.

    Thank you

    Nested XML binding #88228

    Hristo
    Participant

    Hello engineering87,

    It looks a little bit complicated (about <E> tag is needed).
    Also, It is not possible to generate two values together without some additional logic (as a beforeLoadComplete callback of dataAdapter or else).
    Typical XML is like

    <A>
    	<B id="1">
    		<code>26391</code>
    		<M></M>
    		<D></D>
    		...
    		<F></F>
    	</B>
    	
    	<B id="2">
    		...
    	</B>
    </A>

    In your example, XML is nested and should to create some custom logic.
    I would like to suggest you this article could be useful:
    http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-datasources.htm

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.