Hi
I managed to recreate the issue and also identify how to fix it. Please go to http://live.datatables.net/cikovika/3/edit
Click on a row and edit, the fields show. Close form, click refresh and select a row and click Edit, the fields don't show. I think the issue is the editor gets reset becuase I have placed the editor js code inside initTable. Leaving the editor code inside the ready function but outside initTable fixes it. removing the template with the code as it is also fixes it. I think editor does not like resetting the template after a page load. Is this it?
I think editor does not like resetting the template after a page load. Is this it?
Correct. Editor removes the template element from the document, so there is nothing there to select on the second iteration. Way to workaround that? Use a cloned copy:
Hi
There is a slight issue in that I use the Edit form template as a div at bottom of page and it seems editor via the clone method shows the div on the page. If I use $("#EditorForm").hide(); in js' doc ready I get the same problem as before where the fields don't show on the form. Putting a show in the open or preopen editor events does noithing. Kindly advise.
Replies
Hi
I managed to recreate the issue and also identify how to fix it. Please go to http://live.datatables.net/cikovika/3/edit
Click on a row and edit, the fields show. Close form, click refresh and select a row and click Edit, the fields don't show. I think the issue is the editor gets reset becuase I have placed the editor js code inside initTable. Leaving the editor code inside the ready function but outside initTable fixes it. removing the template with the code as it is also fixes it. I think editor does not like resetting the template after a page load. Is this it?
Correct. Editor removes the template element from the document, so there is nothing there to select on the second iteration. Way to workaround that? Use a cloned copy:
Allan
Thanks
Hi
There is a slight issue in that I use the Edit form template as a div at bottom of page and it seems editor via the clone method shows the div on the page. If I use $("#EditorForm").hide(); in js' doc ready I get the same problem as before where the fields don't show on the form. Putting a show in the open or preopen editor events does noithing. Kindly advise.
You could wrap the
EditorForm
element in adiv
which isdisplay:none
.Allan
Good point. Thanks.