hot=newHandsontable(container, { data: [], dataSchema: {id: null}, startCols: 4, colHeaders: ["ID"], columns: [ {data: 'id'} ], rowHeaders: true, minSpareRows: 4, afterChange: function (change, source) { // restore table after reload of a pageif (source==="loadData") { // load data from local storageif (localStorage['data']) { vardata=JSON.parse(localStorage['data']) this.loadData(data); this.render(); return } } else { // save all data to local storge if the edit happendslocalStorage['data'] =JSON.stringify(this.getData()); return } } });