markcell/jquery-tabledit

Use enter key to confirm and remove confirm button

aaaronfeng opened this issue · 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'
            },
        },

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