database uses 'sid' instead of 'id'

database uses 'sid' instead of 'id'

Sasori7Sasori7 Posts: 26Questions: 10Answers: 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: 21,330Questions: 26Answers: 4,951

    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: 26Questions: 10Answers: 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: 15,240Questions: 1Answers: 2,599

    Yep, exactly, that should do the trick,

    Colin

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 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.