How to reload data in a data table in webix? refresh () not reloading data?

The data given in the data table saved its state as "originalState".
   "Webix.storage.local.put (datatable.getState ());"

updated the collation to a column and returned the state to "originalState". var state = webix.storage.local.get ("originalState"); if (state) {datatable.setState (state); }

Every thing works fine (e.g. column reordering, size), but data that was sorted earlier is not reset to the original data. However, it only shows sorted data. Tried update () but it's still the same thing.

+3


source to share


2 answers


There is no way to revert the table back to its unsorted state. You can apply some sort of saved sort, but you cannot "undo" the table.

table.refresh () will only redraw the data to the datatable, it has no other means If you need a real reload of data from a remote data source you need to use



table.clearAll()
table.load(data_url);

      

+8


source


I don't know if it can be reloaded.

I found an example that might help you.



When you "restore state" it also provides sorting:

 function restore_state() {
        var state = webix.storage.local.get("state");
        if (state){
            grid.setState(state);   
            grid.sort("#rank#");
            grid.markSorting("rank", "asc");
        }
    }

      

+1


source







All Articles