jQWidgets Forums

jQuery UI Widgets Forums Grid Stop grid refreshing on page load

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Stop grid refreshing on page load #27179

    davijeb
    Blocked

    Hi,

    I have a grid which I want to be populated only once. All subsequent updates are handled using web sockets. Whats the best way to handle this?

    Thanks,

    Jez

    Stop grid refreshing on page load #27180

    Peter Stoev
    Keymaster

    Hi davijeb,

    When you bind the Grid, it is bound just once. Whether it refreshes its data or not depends on whether you set its source property again to a new jqxDataAdapter instance or call its “updateboundata” method. This help topic illustrates how to bind the Grid: jquery-grid-datasources.htm.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Stop grid refreshing on page load #28229

    davijeb
    Blocked

    I have the following:

    if(typeof $rootScope.gridDataAdapter == 'undefined') {
    $rootScope.gridDataAdapter = new $.jqx.dataAdapter(BlotterSourceFactory.source());
    //$rootScope.gridDataAdapter = new $.jqx.dataAdapter(BlotterSourceFactory.source());
    grid = $("#jqxgrid").jqxGrid({
    width: 1000,
    height: 560,
    source: $rootScope.gridDataAdapter,
    theme: getDemoTheme(),
    sortable: true,
    filterable: true,
    autosavestate: false,
    altrows: true,
    groupable: true,
    columnsresize: true,
    pageable: true,
    columnsreorder: true,
    selectionmode: 'multiplerowsextended',
    pagesizeoptions: [ '20', '100', '1000' ],
    columns: columns
    });
    } else {
    alert('grid ' + $('#jqxgrid'));
    $('#jqxgrid').jqxGrid('updatebounddata');
    $('#jqxgrid').jqxGrid('render');
    $('#jqxgrid').jqxGrid('refreshdata');
    }

    I check to see if we already have a data adapter, if not then I create one (using angularjs) and then create the grid. That all works of. But if I already have a data adapter I just tell the grid to (i guessed this part) render and update itself but on the screen the element is just an empty div.

    Any ideas?

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

You must be logged in to reply to this topic.