jQWidgets Forums

jQuery UI Widgets Forums General Discussions A question of dataAdaptor

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  maorui 12 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • A question of dataAdaptor #20128

    maorui
    Member

    I got a problem in following codes.

    function filldata () {
    data = '<tclist><tc id="2477629"><toroid>2477629</toroid><class>15.01.05. STK7x10</class><name>15.01.05.01~ STK7x10 Controller reset/reboot</name></tc><tc id="2597981"><toroid>2597981</toroid><class>15.04. Dell Compellent</class><name>15.04.23~ Array Controller failover (reset/reboot) test with multiple Fault Domains of Virtual Port Mode using ‘restored daemon’</name></tc></tclist>';
    var source = {
    localdata: data,
    datatype: "xml",
    datafields: [{
    { name: 'ID', map: 'toroid'},
    { name: 'Name', map: 'name' },
    { name: 'Class', map: 'class' }],
    root: "tclist",
    record: "tc",
    id: 'id'
    };
    var dataAdapter = new $.jqx.dataAdapter(source, { autoBind: true });
    $('#tclist').jqxGrid({ source: dataAdapter });
    }

    I hope the data will be showed in Grid in two rows. But actually dataAdaptor merged two records into one. It appended the second records after first one in every fields. The result is like:
    {
    toroid: “24776292597981”,
    class: “15.01.05. STK7x1015.04. Dell Compellent”,
    name: “15.01.05.01~ STK7x10 Controller reset/reboot15.04.23~ Array Controller failover (reset/reboot) test with multiple Fault Domains of Virtual Port Mode using ‘restored daemon’”
    }

    Anything wrong in the XML or somewhere?

    BTW, why no forum of dataAdaptor or jqxdata?

    A question of dataAdaptor #20142

    Peter Stoev
    Keymaster

    Hi maorui,

    Thanks for the feedback.

    As a solution, you may load the XML from a file and set the source object’s url to point to your file instead of localdata.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    A question of dataAdaptor #20147

    maorui
    Member

    It works, thx! But this makes my codes more complex. I do hope the localdata issue can be resolved.

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

You must be logged in to reply to this topic.