There isn't currently an option to destroy an Editor instance. To be honest i hadn't thought that such a method would be useful - are you destroying and creating Editor instances on a regular basis on your page?
No I have never actually had a need to do it. I have two tables on one page and understand the only one instance thing. Both tables are very different from each other so it just seems more cumbersome to add/remove columns from both Datatables and Editor.
Should mention these tables are in a container with tabs which is why I was wanting to destroy the instance for both Datatables and Editor.
For some reason I'm having troubles with 2 instances of Editor that are initialized with two different variables.
Say I select a row and click Edit for that row then I close out the modal without making any changes. I then select the second tab and click the New button. Editor for some reason will fill the modal with the rows information from tab 1 (the first step) for the cells it finds matching names for.
You can include this script to have Editor run on the live site. But it doesn't have a server-side environment to support it for editing. That might be enough to replicate the issue you are seeing though?
If not, even just the code you are using might give me a clue.
I figured out what is causing the issue... It is either Foundation 6 or the editor.foundation.js file. See the following site I set up quickly on DigitalOcean...
You don't even really need data to see the issue. Do these two things to see the issue...
Click New while on the first tab, close out without adding any new entry. Click the second tab and click New again. Notice how the same fields are still in the modal?
Refresh the page and click the second tab first and then click new. Notice how to fields are now different?
I should mention I actually could not reproduce my issue until I added the editor.foundation.js file. If you remove the file and do not use styling, it works as it should and as you mentioned.
Side note: w/ foundation 6 the buttons look like that. I was able to edit the buttons JS file on my actual code so it renders correctly for foundation 6. But in this case it doesn't really matter what it looks like.
Ah I see! Thanks for the clarification. I've not completed the Foundation 6 integration for DataTables and all of its extensions yet.
Having said that, if you use the nightly version of Buttons that should resolve this issue and I have done the Foundation 6 work for Buttons.
The one thing that is holding this up is an incompatibility between the Foundation 5 and 6 pagination control which is causing an issue with the DataTables pagination control.
I am planning for the next release of all software to include Foundation 6 support.
Its a combination of things. The Buttons layout you are seeing in the link is due to the change in Foundation 6 for how their buttons work, so that is constrained to the Buttons CSS. But there is also the Editor modal, which needs to be updated for Foundation 6's changes, and likewise DataTables pagination controls.
Answers
There isn't currently an option to destroy an Editor instance. To be honest i hadn't thought that such a method would be useful - are you destroying and creating Editor instances on a regular basis on your page?
Allan
No I have never actually had a need to do it. I have two tables on one page and understand the only one instance thing. Both tables are very different from each other so it just seems more cumbersome to add/remove columns from both Datatables and Editor.
Should mention these tables are in a container with tabs which is why I was wanting to destroy the instance for both Datatables and Editor.
What "one instance" thing? You can have as many Editor and DataTables instances on the page as you wish.
Allan
For some reason I'm having troubles with 2 instances of Editor that are initialized with two different variables.
Say I select a row and click Edit for that row then I close out the modal without making any changes. I then select the second tab and click the New button. Editor for some reason will fill the modal with the rows information from tab 1 (the first step) for the cells it finds matching names for.
I can provide a test case if need be.
Yes please, a test case would be needed.
Thanks,
Allan
I don't have a public server set up at the moment. Is there anyway using live.datatables.net to use Editor? I highly doubt it.
You can include this script to have Editor run on the live site. But it doesn't have a server-side environment to support it for editing. That might be enough to replicate the issue you are seeing though?
If not, even just the code you are using might give me a clue.
Allan
I figured out what is causing the issue... It is either Foundation 6 or the editor.foundation.js file. See the following site I set up quickly on DigitalOcean...
http://104.236.29.246/datatables/test.php
You don't even really need data to see the issue. Do these two things to see the issue...
Click New while on the first tab, close out without adding any new entry. Click the second tab and click New again. Notice how the same fields are still in the modal?
Refresh the page and click the second tab first and then click new. Notice how to fields are now different?
I should mention I actually could not reproduce my issue until I added the editor.foundation.js file. If you remove the file and do not use styling, it works as it should and as you mentioned.
Side note: w/ foundation 6 the buttons look like that. I was able to edit the buttons JS file on my actual code so it renders correctly for foundation 6. But in this case it doesn't really matter what it looks like.
Ah I see! Thanks for the clarification. I've not completed the Foundation 6 integration for DataTables and all of its extensions yet.
Having said that, if you use the nightly version of Buttons that should resolve this issue and I have done the Foundation 6 work for Buttons.
The one thing that is holding this up is an incompatibility between the Foundation 5 and 6 pagination control which is causing an issue with the DataTables pagination control.
I am planning for the next release of all software to include Foundation 6 support.
Allan
Awesome! Just to clarify... is it the actual Editor files causing this main issue or buttons?
Its a combination of things. The Buttons layout you are seeing in the link is due to the change in Foundation 6 for how their buttons work, so that is constrained to the Buttons CSS. But there is also the Editor modal, which needs to be updated for Foundation 6's changes, and likewise DataTables pagination controls.
Allan
I know your a busy man but any idea of when the new Editor might be released to fix some of these issues? Thanks for all you do.
During February. Hopefully near the start of the month, but I can't promise that at the moment.
The nightly version of Buttons and DataTables will both work correctly with Foundation 6 now.
Allan