jQWidgets Forums

jQuery UI Widgets Forums TreeGrid Refresh Data in TreeGrid

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Refresh Data in TreeGrid #80689

    rao
    Participant

    Hi jqWidget Team,
    I am using jqxTreeGrid in jquery model (not in Angular way).
    Its working good.
    Now in my page, i am providing the refresh button to reload the TreeGrid data.
    During this time, we call the REST API and building the treeGrid.
    In fact i call the same method, which i used for Initial creation.

    I feel, this is not good way to do.
    Do you have any recommendations here ?
    And is there any way, to directly apply/refresh the latest data on existing TreeGrid.
    I believe there should be improvement in performance.

    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    The code looks something similar to below.

    function buildTreeGrid(){

    var source =
    {
    datatype: “jsonp”,
    datafields: [
    { name: ‘countryName’ },
    { name: ‘name’ },
    { name: ‘population’, type: ‘float’ },
    { name: ‘continentCode’ }
    ],
    url: “http://ws.geonames.org/searchJSON”,
    data: {
    featureClass: “P”,
    style: “full”,
    maxRows: 50
    },
    formatdata: function (data) {
    return “my data”;
    }
    };

    var dataAdapter = new $.jqx.dataAdapter(source);

    $(“#treeGrid”).jqxTreeGrid(
    {
    width: 400,
    source: dataAdapter,
    ready: function () {
    $(“#treeGrid”).jqxTreeGrid(‘hideColumn’, ‘name’);
    },
    columns: [
    { text: ‘Name’, dataField: ‘name’, width: 250 },
    { text: ‘Beverage Type’, dataField: ‘type’, width: 250 },
    { text: ‘Calories’, dataField: ‘calories’, width: 180 },
    { text: ‘Total Fat’, dataField: ‘totalfat’, width: 120 },
    { text: ‘Protein’, dataField: ‘protein’, width: 100}
    ]
    });

    }

    Regards,
    Rao.

    Refresh Data in TreeGrid #80691

    Peter Stoev
    Keymaster

    Hi Rao,

    To refresh data, call “updateBoundData” method. In addition, it’s not necessary to call hideColumn within the ready callback. It’s better to set “hidden: true” property of the column you want to hide.

    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.