I am updating my grid every ~5sec with a json string. Everything is working OK. The JSON string is generated on the server and to allow paging on the server I enabled virtualmode. After enabling virtualmode, the grid is flickering every time I refresh.
This is my code:
var source = { datatype: "jsonp", datafields: [ { name: 'Name' }, { name: 'Value', type: 'number' } ], url: url, beforeprocessing: function (data) { source.totalrecords = data.totalResultsCount; }, }; var dataAdapter = new $.jqx.dataAdapter(source, { loadComplete: function () { var length = dataAdapter.records.length; }, loadError: function (xhr, status, error) { console.log(xhr); console.log(status); console.log('Error loading "' + source.url + '" : ' + error); } }); var rendergridrows = function (params) { return params.data; } $("#jqxgrid").jqxGrid( { width: '99.9%', source: dataAdapter, pageable: true, autoheight: true, autoshowloadelement: false, editable: true, pagesize: 20, enableanimations: true, virtualmode: true, rendergridrows: rendergridrows, ready: function() { $("#jqxgrid").jqxGrid('dataloadelement').hide(); }, columns: [ { text: 'Name', datafield: 'Name', width: 350, editable: 0 }, { text: 'Value', datafield: 'Value', width: 100} ] });
Is there anyway to solve this problem?
The refresh is done through calling this function every ~5sec:
function update_data() { $('#jqxgrid').jqxGrid('updatebounddata'); }