Outdated example

Outdated example

sliekenssliekens Posts: 97Questions: 17Answers: 2

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.

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    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

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    Actually no, I read the example incorrectly last night. The field method as only ever accepted a single parameter. I had thought it said editor.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

This discussion has been closed.