【问题标题】:How to add a slide toggle button to every cell in tabulator column如何将滑动切换按钮添加到制表符列中的每个单元格
【发布时间】:2021-05-21 05:19:54
【问题描述】:

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

【问题讨论】:

    标签: javascript uitableview user-interface angular-material tabulator


    【解决方案1】:

    我不使用 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",
            },                  
        ],
    });
    

    【讨论】:

    • 谢谢@MichaelOKeefe
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-04
    • 1970-01-01
    • 1970-01-01
    • 2017-01-28
    • 1970-01-01
    • 2020-02-08
    • 1970-01-01
    相关资源
    最近更新 更多