database uses 'sid' instead of 'id'

database uses 'sid' instead of 'id'

Sasori7Sasori7 Posts: 25Questions: 9Answers: 0

In this discussion, https://datatables.net/forums/discussion/52985/datatable-with-checkbox-how-to-get-ids, it's not clear if it the first column must be 'id'. My database is set up to use 'sid'.

Also, how does this affect editor?

Answers

  • kthorngrenkthorngren Posts: 17,759Questions: 25Answers: 4,216

    I might not understand the question but the Editor's idSrc option is hwo you tell Editor what your row ID is. Datatables uses rowId.

    The first column doesn't need to be id nor does it need to contain the ID for the row.

    Kevin

  • Sasori7Sasori7 Posts: 25Questions: 9Answers: 0
    edited February 2022

    ok, in my mysql database the 'id' is a column named 'sid'
    In the example you provided, it's referred to as 'id'.
    and idSrc:'sid' will work?

  • colincolin Posts: 14,618Questions: 1Answers: 2,497

    Yep, exactly, that should do the trick,

    Colin

  • allanallan Posts: 57,737Questions: 1Answers: 9,204 Site admin

    If you are using our server-side libraries for Editor see this page for details on how to specify the primary key column name. You don't then need to use rowId / idSrc as the libraries will take care of it for you.

    Allan

Sign In or Register to comment.