Posted 7 June 2018, 5:47 pm EST
Hi sir/mam,
I need to update an spread view grid. I have an columns list, now i updating an data items with new values, here i need to refresh the grid without page load.
My Codes as follows,
On Init
var data = [{ city: null, createdDate: "0001-01-01T00:00:00", createdUser: null},
{ city: null, createdDate: "0001-01-01T00:00:00", createdUser: null},
{ city: null, createdDate: "0001-01-01T00:00:00", createdUser: null},
{ city: null, createdDate: "0001-01-01T00:00:00", createdUser: null},
];
On update my data list changed as follows
var data = [{ city: 'NY', createdDate: "2018-06-08 00:00", createdUser: 'Arul'},
{ city: null, createdDate: "0001-01-01T00:00:00", createdUser: null},
{ city: 'LA', createdDate: "2018-06-08 00:00", createdUser: 'Venthan'},
{ city: null, createdDate: "0001-01-01T00:00:00", createdUser: null},
];
now i need to update the grid without any dataview reload.
My code as follows on init
dataView = new GC.Spread.Views.DataView( document.getElementById( 'grid1' ), data, columns,
new GC.Spread.Views.Plugins.GridLayout( {
allowSorting: false,
showColHeader: true,
showRowHeader: false,
allowResizing: true,
selectionMode: 'single',
showToolPanel: false,
allowColumnReorder: true,
allowCellMerging: true,
//grouping: grouping
} ) );
on update i tried
dataView.refresh();
dataView.invalidate();
also tried by
dataView.data.refresh();
dataView.invalidate();
Its not working for me, while i re-init the dataview its loads and took much to load grid.
Thanks,
Arulventhan NP