jquery-tabledit icon indicating copy to clipboard operation
jquery-tabledit copied to clipboard

Use enter key to confirm and remove confirm button

Open aaaronfeng opened this issue 6 years ago • 1 comments

How can I remove the confirm button which is not useful in this case?

image

Following the code:

$('#table').Tabledit({
        url: 'url',
        saveButton: false,
        autoFocus: false,
        buttons: {
            edit: {
                class: 'btn btn-primary',
                html: 'EDIT',
                action: 'edit'
            },
        },

aaaronfeng avatar Oct 24 '18 08:10 aaaronfeng

What i would do is, adding a hidden class to the confirm button ( in the buttons config part) and then edit the delete function to mimic the confirm.

Try to edit theese lines:

  $table.on('click', 'button.tabledit-confirm-button', function(event) {

to

$table.on('click', 'button.tabledit-delete-button', function(event) {

And the current: $table.on('click', 'button.tabledit-delete-button', function(event) { to $table.on('click', 'button.tabledit-delete-button_old', function(event) {

I think you will get what you want by doing this.

PLEASE BACKUP FIRST

websitecareio avatar Apr 03 '19 23:04 websitecareio