Datatable icon indicating copy to clipboard operation
Datatable copied to clipboard

how to set my own table ID

Open VickG opened this issue 10 years ago • 3 comments

Currently, this plugin generates a random ID, .e.g. oTable = jQuery('#32VlMzL3').dataTable();

How can I define my own ID?

I tried the setId(); function, but it's complaining it does not exist.

VickG avatar Mar 31 '15 21:03 VickG

Hmmm, are you calling setId() on the datatable function itself? Ex:

Datatable::table()
->setId('myCustomId')
->addColumn('A', 'B', 'C')
->setUrl('api/test')
->render()

Which version of the library are you currently using?

johnhatch avatar Mar 31 '15 21:03 johnhatch

Yes I am.. just as you have put it.

I am using version 1.9.4 of dataTables and latest master from here

VickG avatar Mar 31 '15 21:03 VickG

it seems like I cannot call some of the built in functions, getting similar error on setCallbacks(); Call to undefined method Chumper\Datatable\Engines\CollectionEngine::setCallbacks()

VickG avatar Mar 31 '15 22:03 VickG