jQuery UI Widgets › Forums › Grid › Stop grid refreshing on page load
Tagged: datagrid control
This topic contains 2 replies, has 2 voices, and was last updated by davijeb 9 years, 9 months ago.
-
Author
-
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
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 StoevjQWidgets Team
http://www.jqwidgets.comI 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?
-
AuthorPosts
You must be logged in to reply to this topic.