You can set it either during the Handsontable initialization or using the updateSettings method. The persistentState option must be set to true to enable the data storage mechanism. You can save any type of data in local storage to preserve the table state after page reloads. setRequestHeader ( 'Content-type', 'application/x-www-form-urlencoded' ) Ĭlick "Load" to load data from server # Saving data locally setRequestHeader ( 'X-Requested-With', 'XMLHttpRequest' ) const container = document.querySelector('#example1') Ĭonst exampleConsole = document.querySelector('#example1console') Ĭonst autosave = document.querySelector('#autosave') Ĭonst load = document.querySelector('#load') Ĭonst save = document.querySelector('#save') Ĭonst hot = new Handsontable(container, You need to implement the server-side part by yourself. Note that this is just a mockup, and nothing is actually saved. In the example below, Ajax is used to load and save the data. Use the afterChange callback to track changes made in the data grid. Persistent state storage is particularly useful when running multiple instances of Handsontable on one page as it allows data separation per each instance.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |