Multiple editors
Multiple editors
Hello,
What would be the best way to pass data to additional editor, I'm understanding that
table: "#datatable_edit_employees",
is what tells main editor where to find data to populate form. But if I have another editor on the same page is there a way to tell that editor to get data from different source, let's say JavaScript object or array.
I have a table where I have typical columns and editor works great, but I want on the same page another editor that saves different fields not related to that table.
Regards,
This question has accepted answers - jump to:
Answers
What is the second Editor related to? A different DataTable, or perhaps a standalone form?
Allan
Standalone. Allan seriously are you trying to create a programming framework/language out of that datatables. Love it, stand alone seem to be exactly what I'm after.
Standalone works great and all. The only problem that I can not solve is how to update/refresh editors data after submitting it to server, which works well. I'm using set() to set all the columns, but how do set it again at run-time for that editor to apply submitted changes?
Here is that code:
Yes, its funny how complex something as simple as a table and a form can become .
If you aren't using the attributes such as
data-editor-field
to tell Editor where to get and set values from, you need to do it directly yourself. That would be done in thepostEdit
event, which will give you access to the data that was edited - e.g.:The
data-editor-field
attribute more or less does the same thing - just with added magic (to use Apple terminology...).Allan
Since I do not display that data anywhere in the DOM just edit, I went with turning "editor_data" variable into a function.
Now on postEdit I can manipulatethat variable and next time I edit, changes get applied. Without any magic.
Thanks Allan