masterCheckbox in a datatable

2019-07-11 02:51发布

I'm trying to add a masterCheckbox to the webix datatable items. For now, I got the following behavior: when I click on the master checkbox, the values rewrite to 1 or 0

{ 
    id:"title", 
    checkValue:"on", 
    uncheckValue:"off", 
    template:"{common.checkbox()} #title#", 
    header:["Title", {content:"masterCheckbox", contentId:"checkAll"}],
    fillspace:true
}

http://webix.com/snippet/26750201

Aby idea what I'm doing wrong?

1条回答
冷血范
2楼-- · 2019-07-11 03:21

The only example with the masterCheckbox I found is this sample.

Seems like the masterCheckbox changes the value in the current column. I.e. in your sample title becomes on or off. I suppose the provided use-case is to have a separate column with {common.checkbox()}:

columns:[
  { id:"ch1", header:{ content:"masterCheckbox", contentId:"mc1" }, template:"{common.checkbox()}", width:40}      
],    

Sample: http://webix.com/snippet/17a28a40

查看更多
登录 后发表回答