Custom Form Delete Button
Custom Form Delete Button
isport59
Posts: 30Questions: 9Answers: 2
I'd like to have a delete button in my form. I tried the code below. It generates a confirmation box with a confirm delete button but when I click the button nothing happens. It keeps looping. An answer to my problem would be greatly appreciated.
Here is the link to my page:
http://editor.uhmind.com/examples/api/backNext.html
label: 'delete',
fn: function (e, data, remove) {
this.title('Delete row')
this.buttons('Confirm delete')
this.message('Are you sure you want to remove this row?')
this.remove(this);
}
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi,
I think the problem is with
this.remove( this )
. In that contextthis
is the Editor instance (which is why you can call the Editor methods), so passingthis
intoremove()
won't work, asremove()
is expecting an identifier for the row to be removed.What you can do however is use the
modifier()
method to get that information. So I think simply:should be the only change required!
Regards,
Allan
That did the trick. Thanks a mile!
Mike