Question about changing the default form for Editor's Delete
Question about changing the default form for Editor's Delete
Chilllburger
Posts: 1Questions: 1Answers: 0
Hello, I'm using Editor via a licensing deal with my employer and I have a few questions about changing some of the behavior.
When clicking on a row, you usually get a pop up asking you "Are you sure you wish to delete 1 row?". Is there anyway to change this default message with the Editor API? Also, is it possible to move the 'x' cancel button's functionality to a cancel button beside the 'Delete' button on the bottom of the form?
Thanks!
This discussion has been closed.
Answers
Absolutely - the
i18n.remove.confirm
option can be used to change the message.Another option is to use the
message()
option can be used to change the form message. You could listen for theopen
event and callmessage()
when theremove
form type is shown.You could add another button using the
buttons()
method (in this case would would need to useopen
). Thex
would remain (you could remove it using CSS, but there isn't a way to target it for just the remove form I think), but the functionality would then be consistent.Regards,
Allan
I'm encountering a bit of an issue using the included APIs.
In my current page, I'm trying to set a custom message for the 'remove' action, like so:
This occurs within the definition of the editor object.
But on my page, the delete function does not seem to create the message correctly.
Here is a screenshot of the resulting message:
http://i.imgur.com/YkXyFmA.png
Any idea for why the message text is not rendering?
I've just tried the code above in a local example and it appears to work as expected. Could you show me the full Javascript that you are using for the Editor and DataTables initialisation?
It looks like the message might be getting set somewhere else and as a string rather than the object with
_
and1
properties (hence the single character selection from the string - perhaps there were six rows selected for the screenshot for example?).Thanks,
Allan
I've managed to get the form message to change correctly using the i18n option, turns out to be an issue else where in my code.
I was also trying to add a custom cancel button to my delete code using the button() method but am having some issues getting it to work. Can you look over my code here to see if I'm doing anything incorrectly?
Thanks a bunch!
That looks like it should work okay. I'm guessing it doesn't though?
Try this:
Two changes:
remove()
method which should be a little more resilient to any timing errors if you are using inline editing.$(this).closest('tr')
.Regards,
Allan
I'm still getting no changes to the Delete form. The i18n option seems to be the only method that results in any changes.
Are you able to PM me a link to the page so I can debug it please? Just click on my user name above and then the "Send Message" button.
Allan
We do not have a public link, since it's for an internal website.
Can you drop me through the full Javascript that you are using in that case so I can try to recreate the issue and debug it?
Thanks,
Allan