Outdated example
Outdated example
This page contains an outdated example: https://editor.datatables.net/reference/api/field()
editor.field( 'first_name' ).val( 'Allan' );
// results in the same action as (the difference is in the returned values,
// not used here):
editor.field( 'first_name', 'Allan' );
Only the first line of code works in the current version of Editor.
This discussion has been closed.
Replies
Actually both should work. It looks like there might be a bug in the second one as that should work. That API has not been removed.
Allan
Actually no, I read the example incorrectly last night. The
field
method as only ever accepted a single parameter. I had thought it saideditor.val( ... )
which obviously it doesn't having read it again!I've removed the second part from the example. Thanks for pointing that out.
Allan