问题
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:
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
来源:https://stackoverflow.com/questions/38878786/mastercheckbox-in-a-datatable