jQuery UI Widgets Forums Grid Xml Data wont load in grid

This topic contains 2 replies, has 2 voices, and was last updated by  Peter Stoev 10 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Xml Data wont load in grid #2979

    sadranyi
    Member

    Hi I just started testing the grid widgets , but i cant get any of the xml data to be loaded into the gird, it loads without data. below is the code am using

    var theme = getTheme();
    var repurl = “../data/reps.xml”;

    // Preparing Data
    var repSource =
    {
    datatype: “xml”,
    datafields:
    [
    { name: ‘RepName’ },
    { name: ‘RepCode’ },
    { name: ‘Branch’ },
    { name: ‘CRDNumber’ },
    { name: ‘NumberofAccounts’ },
    { name: ‘NumberofTrades’ },
    { name: ‘NumberofCancels’ },
    { name: ‘AverageCommission’ },
    { name: ‘AveragePH’ },
    { name: ‘AverageCOA’ },
    { name: ‘AverageTurnover’ }
    ],
    root: “Reps”,
    record: “Rep”,
    id: “RepID”,
    url: repurl
    };

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

    // Initialize Grid
    $(“#repGrid”).jqxGrid(
    {
    width: 760,
    source: repDataAdapter,
    theme: theme,
    //pageable: true,
    //autoheight: true,
    //sortable: true,
    //altrows: true,
    //selectionmode: ‘singlecell’,
    //enabletooltips: true,
    columnsresize: true,
    columns:
    [
    { text: ‘Rep Name’, datafield: ‘RepName’, width: 100 },
    { text: ‘Rep Code’, datafield: ‘RepCode’, width: 100 },
    { text: ‘Branch’, datafield: ‘Branch’, width: 100 },
    { text: ‘CRD Number’, datafield: ‘CRDNumber’, width: 100, cellsalign: ‘right’ },
    { text: ‘No. of Accounts’, datafield: ‘NumberofAccounts’, width: 120, cellsalign: ‘right’},
    { text: ‘No. of Trades’, datafield: ‘NumberofTrades’, width: 110, cellsalign: ‘right’},
    { text: ‘No. of Cancels’, datafield: ‘NumberofCancels’, width: 120, cellsalign: ‘right’},
    { text: ‘Avg Comm.’, datafield: ‘AverageCommission’, width: 100, cellsalign: ‘right’},
    { text: ‘Avg P & H’, datafield: ‘AveragePH’, width: 100, cellsalign: ‘right’},
    { text: ‘Avg COA’, datafield: ‘AverageCOA’, width: 100, cellsalign: ‘right’},
    { text: ‘Avg Turnover’, datafield: ‘AverageTurnover’, width: 120, cellsalign: ‘right’},
    ]
    });

    • This topic was modified 10 years, 10 months ago by  sadranyi.
    • This topic was modified 10 years, 10 months ago by  Peter Stoev. Reason: moved to the Grid Forum
    Xml Data wont load in grid #2984

    Peter Stoev
    Keymaster

    Hi sadranyi,

    Could you post a valid .xml file? I also suggest you to take a look at this help topic which shows how to load XML into the Grid.

    Looking forward to your reply.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Xml Data wont load in grid #2992

    Peter Stoev
    Keymaster

    Hi sadranyi,

    I prepared online demo from your xml and using the code I posted in my last post. Here’s the demo link: Online Demo

    Download Project: bindtoxml.zip.

    I suppose that the url to your xml data was incorrect.

    Best Regards,
    Peter Stoev

    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.