How to programmatically set template attribute in Editor 1.6?
How to programmatically set template attribute in Editor 1.6?
Hi folks,
Is there a way to set and unset (above all) the new template
attribute for a Datatables Editor instance? I have a table which changes columns drastically depending on it's usage and I would like to use a template for its editor depending on certain conditions. Is this possible?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Currently no - sorry. That is not something I had thought of before. Currently the template can only be set at initialisation time, but there shouldn't be any technical barrier to being able to create an API so it can be changed. I'll look into that and hopefully make it available in 1.6.2.
Regards,
Allan
Thanks for your response and thanks for thinking about integrating this, Allan!
Just a quick follow up on this. I've committed a new
template()
method that will be available in Editor 1.6.2 which I hope to release later this week.Regards,
Allan
Cool, thanks a bunch Allan !
Allan, I think there is a bug on
template()
method. It works on the first load of form but succeeding calls display empty form.The code above works on the first click/edit of row. However, clicking the next edit button, the modal will display with empty form. ATM, my workaround is to create a duplicate editor form with a different template. Thanks!
Hi @yajra. What version of Editor is it that you are using? 1.7.4 should work with that.
Thanks,
Allan
Hi @allan, I am using 1.7.4. Have been testing it multiple times and just tried again today. It does work only on first call but succeeding calls returns an empty form.
Attaching a sample form image.
Below is the first click.
Here is the next call onwards.
Interesting. Do you have a page you can give me a link to so I can trace it through?
Allan