将复选框值存储在webix的cookie中
Store checkbox value in cookie in webix
我正在使用webix显示具有特定列的数据表。我为每个列创建了一个复选框来显示/隐藏这些列。我需要将这些复选框值存储在cookie中,这样当客户端刷新页面时,选中的复选框保持选中/未选中状态。我该怎么做呢?
下面是我的代码: {
view: "toolbar",
cols: [
{ view: "checkbox", id: "test1", label: "test1", value:1 },
{ view: "checkbox", id: "test2", label: "test2", value: 1 },
{ view: "checkbox", id: "test3", label: "test3", value: 1 },
{ view: "checkbox", id: "test4", label: "test4", value:1 }
]
},
{
view: "datatable",
id: "table",
columns: [
{ id: "test1", header: ["test1"] },
{ id: "test2", header: ["test2"] },
{ id: "test3", header: ["test3"] },
{ id: "test4", header: ["test4"] },
],
}
使用webix.storage.local.put()和webix.storage.local.get()函数解决此问题。我有附件onChange事件上的复选框和setValues保存当前的复选框设置。
相关文章:
- 在jquery中为显示/隐藏设置cookie
- 按下按钮时保存cookie
- 如何在Analytics.js中始终了解最新的cookie过期时间
- php httponly cookie在浏览器关闭时被删除
- 如何在提交表单时将PHP变量传递到Javascript cookie中
- CORS-服务器端cookie没有保存在chrome浏览器上
- 如何为后台更改程序代码设置cookie
- 如何从另一个域加载cookie
- 使用jquery cookie的第三方cookie
- 无法在基于Cordova的应用程序中读取Set Cookie标头
- 如何在Javascript中将单选按钮值保存到cookie中
- cookie加载事件页面重定向
- MVC C#从jQuery和JSON.stringify创建的cookie中读取值
- 为什么可以't我在谷歌浏览器中返回cookie
- 如何使用单选按钮设置cookie值
- PhantomJS(vs nightwatch.js)设置cookie错误
- 如何照顾CSRF&单页应用程序中不使用cookie的XSS攻击
- 未使用Javascript在IE中设置Cookie
- 是一个javascript bookmarklet,可以设置破坏跨域安全的域cookie
- 将复选框值存储在webix的cookie中