我使用此插件:https://github.com/sindu12jun/table-dragger
我想将排序数据表保存在localStorage上,当用户重新加载页面时,我想为他保存订单表。我该怎么办?
我有代码:
var el = document.getElementById('table');
var dragger = tableDragger(el, {
mode: 'column',
dragHandler: '.handle',
onlyBody: true,
animation: 300
});
dragger.on('drop',function(from, to){
// Setting the Value.
localStorage.setItem("keyName", "value"); // Syntax
localStorage.setItem("table_layout", table_layout); // by variable
localStorage.setItem("table_layout", "from to?"); // by value
// Get the value.
localStorage.getItem("table_layout");
// Clear one item.
localStorage.removeItem("table_layout");
// Clear all items.
localStorage.clear();
});
这是我的代码。但是我不知道如何正确保存订单。