database uses 'sid' instead of 'id'
database uses 'sid' instead of 'id'
Sasori7
Posts: 26Questions: 10Answers: 0
in DataTables
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
I might not understand the question but the Editor's
idSrc
option is hwo you tell Editor what your row ID is. Datatables usesrowId
.The first column doesn't need to be
id
nor does it need to contain the ID for the row.Kevin
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?
Yep, exactly, that should do the trick,
Colin
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