always update editor hidden field
always update editor hidden field
when i create or edit a table row, I want to update my table with a php session variable to show the userid of the person who last made the change,
i have created a hidden field in my editor, with a default value, and this works fine when i create a new record, but I also want to update the field value on edit, -
i found reference to fields and default values here...https://editor.datatables.net/reference/api/field().def() but i can't work out where to apply it
This question has an accepted answers - jump to answer
Answers
Hi,
If you happen to be using 1.4 beta, then thee is a better way - use the new
setValue()
method as it will avoid the client-side needing to send this information, since it is really server-side only data (otherwise you open yourself to a security issue whereby someone could easily modify the sessions ID to make it look like someone else updated content...).In 1.4 beta you would use:
In 1.3 then using client-side information probably is the cleanest way of doing it. Take a look at the
fields.def
initialisation option, which should be easier to use that the API method (although they do both basically control the same thing).Allan
was running 1.3.3
just installed the 1.4 beta - and glad I did
easy to implement and your solution works perfectly.
Thanks
Good to hear - thanks for the feedback :-).
I think 1.4 is shaping up nicely imho!
Allan