Editor Modal Doesn't Open after fnAjaxReload
Editor Modal Doesn't Open after fnAjaxReload
Hi,
I'm experiencing some issues getting the editor modals to play nice when using the fnAjaxReload extension. I'm having to the use the fnAjaxReload extension because there is no server-side code backing my page, even though it is written in JSP. I'm using only ajax calls to a REST endpoint I control to fetch all my data for the page, thus setting bServerSide and bProcessing to true has no effect. When I make create, edit or delete a row I use the extension to force the table to update without having to refresh the entire page. Unfortunately doing this seems to have the knock on effect of breaking the create, edit and remove modals. Is there some other magic step I'm missing to reset those modals?
Thanks in advance!
My basic setup uses the following scripts in order:
jquery.dataTables.min.js
dataTables.tableTools.js
dataTables.editor.min.js
dataTables.bootstrap.js
dataTables.editor.bootstrap.js
dataTables.fnReloadAjax.js
jquery.dataTables.css
dataTables.bootstrap.css
the setup for my editor is given below
subjectGroupEditor = new $.fn.dataTable.Editor( {
"ajaxUrl": {
"create": "${pageContext.request.contextPath}/rest/study/" + <%= request.getParameter("id") %> + "/subjectgroup/save",
"edit": "${pageContext.request.contextPath}/rest/study/" + <%= request.getParameter("id") %> + "/subjectgroup/save",
"remove": "${pageContext.request.contextPath}/rest/study/" + <%= request.getParameter("id") %> + "/subjectgroup/"
},
"ajax": function ( method, url, data, successCallback, errorCallback ) {
if(data.action == "remove")
{
for (var i=0; i
I'm experiencing some issues getting the editor modals to play nice when using the fnAjaxReload extension. I'm having to the use the fnAjaxReload extension because there is no server-side code backing my page, even though it is written in JSP. I'm using only ajax calls to a REST endpoint I control to fetch all my data for the page, thus setting bServerSide and bProcessing to true has no effect. When I make create, edit or delete a row I use the extension to force the table to update without having to refresh the entire page. Unfortunately doing this seems to have the knock on effect of breaking the create, edit and remove modals. Is there some other magic step I'm missing to reset those modals?
Thanks in advance!
My basic setup uses the following scripts in order:
jquery.dataTables.min.js
dataTables.tableTools.js
dataTables.editor.min.js
dataTables.bootstrap.js
dataTables.editor.bootstrap.js
dataTables.fnReloadAjax.js
jquery.dataTables.css
dataTables.bootstrap.css
the setup for my editor is given below
subjectGroupEditor = new $.fn.dataTable.Editor( {
"ajaxUrl": {
"create": "${pageContext.request.contextPath}/rest/study/" + <%= request.getParameter("id") %> + "/subjectgroup/save",
"edit": "${pageContext.request.contextPath}/rest/study/" + <%= request.getParameter("id") %> + "/subjectgroup/save",
"remove": "${pageContext.request.contextPath}/rest/study/" + <%= request.getParameter("id") %> + "/subjectgroup/"
},
"ajax": function ( method, url, data, successCallback, errorCallback ) {
if(data.action == "remove")
{
for (var i=0; i
This discussion has been closed.
Replies
I don't have a record of your Editor license. Could you confirm for me which DataTables account you are using the license from or as a trial, so I can keep my records up-to-date and direct support as appropriate?
Thanks,
Allan
I'm on the trial at the moment just assessing if it fits the needs of the project I'm working on. We're actually a research project in a university, is there a licence that covers research projects or is it commercial stuff only?
In terms of the issue above, it does sound like the description in the link you provided. I'm not attaching any custom events I'm just using the standard editor setup, the events that don't work second time around are the create, edit and remove buttons in the editor toolbar that gets placed above the table. Is there a way I can trigger some kind of rebind? Or perhaps you can think of another way of refreshing my table after a CRUD operation without using fnAjaxReload.
Thanks,
Mark
Thanks for the explanation - If its non-profit, then absolutely there is a discount available. Drop me a line via e-mail allan @ this domain and I'll set it up with you.
When you say "the second time" - what is actually happening? Are you destroying the old table and creating a new one, but with the same Editor instance, or are you simply calling fnReloadAjax on the existing table and then the Editor buttons no longer work (that shouldn't be the case - they should work fine in that setup!).
Allan