简体   繁体   中英

JQuery Jtable Change position of Add/Edit button

Is there any way to change the position of jquery jtable edit or delete button? They appear at the last columns of the row ie at the right most end. Is there any way to bring them in the left ie at the beginning of the row?

You can add custom icons anywhere you want

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);
                        }
                }
            },
        },

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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