简体   繁体   中英

Reinit Datatables with plugin?

I have a datatables initialized by other JS (I can't add any option to initializing function), and now I want to add a rowReorder plugin. Can I do that without destroying it and creating again?

It is doable if the DataTable instance is stored in a accessible variable. Example: If that "other JS" have passed the instance to a global variable called table then you can

new $.fn.dataTable.RowReorder( table, {} );

{} is an object literal holding options for rowReorder, passing an empty literal is the same as rowReorder: true .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM