Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/461.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何向制表器列中的每个单元格添加滑动切换按钮_Javascript_Uitableview_User Interface_Angular Material_Tabulator - Fatal编程技术网

Javascript 如何向制表器列中的每个单元格添加滑动切换按钮

Javascript 如何向制表器列中的每个单元格添加滑动切换按钮,javascript,uitableview,user-interface,angular-material,tabulator,Javascript,Uitableview,User Interface,Angular Material,Tabulator,我正在尝试添加到tablator表中列中的每个单元格。我需要将on click()函数与此幻灯片切换按钮相关联。如何在制表器中为列中的每个单元格添加角度切换开关 我不使用angular,但我有自己的幻灯片切换,只使用格式化程序“html”。因此,我假设您可以根据需要插入代码/对象 新制表器(“制表器”{ 数据:[{ “一”:“一”, “二”:“一”, },{ “一”:“二”, “二”:“二”, },{ "一":"三",, "二":"三",, }, ], 栏目:[{ 标题:"一",, 字段:“一

我正在尝试添加到tablator表中列中的每个单元格。我需要将on click()函数与此幻灯片切换按钮相关联。如何在制表器中为列中的每个单元格添加角度切换开关


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

新制表器(“制表器”{
数据:[{
“一”:“一”,
“二”:“一”,
},{
“一”:“二”,
“二”:“二”,
},{
"一":"三",,
"二":"三",,
},
],
栏目:[{
标题:"一",,
字段:“一”,
格式化程序:“html”,
},
{
标题:“两个”,
字段:“两个”,
},                  
],
});

谢谢@MichaelOKeefe
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",
        },                  
    ],
});