【问题标题】:JQuery Jtable Change position of Add/Edit buttonJQuery Jtable 更改添加/编辑按钮的位置
【发布时间】:2021-02-10 21:55:59
【问题描述】:

有什么办法可以改变jquery jtable编辑或删除按钮的位置吗?它们出现在行的最后一列,即最右端。 有没有办法把它们放在左边,即行的开头?

【问题讨论】:

标签: javascript jquery css jquery-ui jquery-jtable


【解决方案1】:

您可以在任何地方添加自定义图标

fields: {
            Name: {
                title: 'Name'
            },
            Email: {
                title: 'Email',
                key: true,
                list: true,
                display: function (data) {  // display text with Icon
                    var delete_icon = document.createElement('a');
                    delete_icon.className = 'btn'
                    delete_icon.setAttribute('href', '#');
                    delete_icon.setAttribute(
                       'onClick', 'YourFunctionName(' + your paramters+ ');'
                     );
                     return $(data.records.Email + '--'+ delete_icon);
                }
            },
            'DeleteIcon': {
                width: '1%',
                sorting: false,
                display: function(data) {
                        if (data.record) {
                            var delete_icon = document.createElement('a');
                            delete_icon.className = 'btn'
                            delete_icon.setAttribute('href', '#');
                            delete_icon.setAttribute(
                                'onClick', 'YourFunctionName(' + your paramters+ ');'
                            );
                            return $(delete_icon);
                        }
                }
            },
        },

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-05
    • 2020-03-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多