Skip to content
Advertisement

Datatables rowId starting with a number issue

According to the Datatables specs, I can add a unique ID to every row in my table:

JavaScript

However, the same spec says that IDs cannot start with a number. staffIdin my case is a number, I tried to add some prefix to it:

JavaScript

However, this didn’t work. Any ideas?

Advertisement

Answer

Use function-expression as a value for rowId and return manipulated string to be used as ID

JavaScript

Fiddle here

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement