Using editor without DB for data
Using editor without DB for data
I want to use editor on data stored in JSON format on the form in field. The customer fills in questions and clicks add to add those values as a row into the dataTable. The datatable is stored in a hidden field as a json. The editor comes in on the second step, when that record is passed off to the fulfiller. That table is available to the fulfiller (still a hidden field, this time prepopulated with what the customer filled in). The fulfiller wants to be able to add/edit the row in place--so we bought editor. But the docs say "Client / server communication is required in order to provide the initial data for the DataTable and then for Editor to instruct the server to create, edit or delete rows as required by the end user." But currently everything, including loading the data into the table, is done client side from the hidden field with JS. Is there any way to integrate editor into our current process? Or did we waste our money? Am I misunderstanding the documentation or does it not support what we are trying to do?
A view into the first step of what we are doing is here: http://community.kineticdata.com/Kinetic_Request/Kinetic_Request_Remedy_Edition/Solutions/Putting_Answers_into_DataTables
In the second step the build and save functions are very much the same (but with extra columns). We wanted to be able to use editor to allow for in-line editing instead of them having to select a row, make updates in fields, then re-save it.
Answers
Found this: https://editor.datatables.net/examples/advanced/localstorage.html
Looks like it might be what I needed. Will give it a go.
Support for editing a DataTable without having an Ajax request made to the server-side is a feature that will be introduced in v1.6. It will then be up to the developer implementing the page how the data gets permanently stored.
In the meantime, that can be done by overriding the
ajax
option. I've put an edit only example together here: http://live.datatables.net/cazatabe/1/edit . Creating rows and deleting them is not something that example does, although they could be readily added.Regards,
Allan