Loaders for plug-ins
Plug-ins are a very important part of the DataTables eco-system. They expand DataTables' capabilities, wrap common actions into simple functions and provide a way for code to be shared in the community. We store plug-ins developed by ourselves and also those submitted from the community in our plug-ins repo and document them on this site. However, to date, there hasn't been much consistency in how the plug-ins are written. With the release of DataTables 1.13.3 today, and the plug-ins repo alongside it, that has now changed.
All plug-ins now:
- Are formatted by Prettier More (basically Prettier with a few extra options).
- Provide multiple loader options:
- Provide Typescript definitions for themselves.
Note that there are two exceptions to these rules:
- The paging plug-ins have not been updated. The paging API in DataTables needs work, which will be addressed in a future version.
- Legacy plug-ins have not been updated, since they are no longer needed (e.g. currency sorting).
Using the plug-ins
The documentation for each plug-in type has been updated so you aren't left wondering how you can actually make used of a plug-in. If we take the
average() API plug-in as an example, you will be able to see that it has instructions for:
- Loading in the browser from our CDN (or you can download and host it locally)
- Installing via the
datatables.net-pluginsNPM package and then:
- Loading as an ES module, or
- Loading as a Common JS module.
Continued move to ESM and Typescript
Got an idea of a plug-in? Head on over to the plug-ins repo and submit a pull request with your plug-in there (with the exception of translations, which should be submitted on this site). The directory organisation for the plug-in categories is self explanatory, and each contains a
If you have any questions about contributed, feel free to open a discussion in the forum.