繁体   English   中英

如何将滑动切换按钮添加到制表符列中的每个单元格

[英]How to add a slide toggle button to every cell in tabulator column

我正在尝试添加到制表符表中列中的每个单元格。 我需要将 click() function 与此滑动切换按钮相关联。 如何在制表器的列中为每个单元格添加 angular 拨动开关?

我希望表格具有如图所示的滑动切换按钮。

我不使用 angular,但我有自己的幻灯片切换,只使用格式化程序“html”。 所以我认为您可以根据需要获取要插入的代码/对象

https://jsfiddle.net/o5whLz4j/

new Tabulator("#tabulator", {
    data:[ {
            "one": '<input id="oneone" type="checkbox" class="switch"><label id="oneonelabel" for="oneone">One</label>',
            "two": "1",
        },{
            "one": '<input id="onetwo" type="checkbox" class="switch"><label id="onetwolabel" for="onetwo">Two</label>',
            "two": "2",
        },{
            "one": '<input id="onethree" type="checkbox" class="switch"><label id="onethreelabel" for="onethree">Three</label>',
            "two": "3",
        },
    ],
    columns: [{
            title: "One",
            field: "one",
            formatter: "html",
        },
        {
            title: "Two",
            field: "two",
        },                  
    ],
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM