Blog
On the DataTables blog you will find news, announcements and tutorials about DataTables and its suite of extensions. New posts are published (usually!) monthly, with additional news items in between.
Experiment: Import Maps
With ES modules gaining traction throughout the entire Javascript ecosystem, it is natural to want to use them directly in the browser. We can do that through the type="module"
attribute for a script
, but the browser needs to be able to resolve import names into Javascript files that can be loaded and executed. The importmap
script type is the solution to that problem.
For DataTables, we could create a really simple import map like this (note that DataTables has a dependency on jQuery, hence we need to add a resolver for it as well, even if we don't actually write any jQuery code here):
<script type="importmap">
{
"imports": {
"jquery": "https://esm.sh/jquery@3.6.3",
"datatables.net": "https://cdn.datatables.net/1.13.3/js/jquery.dataTables.min.mjs"
}
}
</script>
Now that the browser has that mapping available, we can import
and use DataTables as normal:
<script type="module">
import DataTable from 'datatables.net';
window.addEventListener('DOMContentLoaded',function () {
new DataTable('#example');
});
</script>
You can see that script and loading here.
The goal in this post is to explore how we might be able to make DataTables easily usable via import maps with DataTables, assessing advantages and limitations of this approach.
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. But 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:
- ESM
- CommonJS
- AMD
- Browser
- Provide Typescript definitions for themselves.
Editor 2.1
I'm delighted to announce the immediate availability of Editor 2.1 and DataTables 1.13.2.
Editor 2.1 is the cumulation of months of tweaks, features and fixes, and you'll be able to see from its release notes that the changes touch almost every part of the code base. Highlights include:
- More complete whole row inline editing controls, shown in this example
- Significant performance improvements for server-side processing with SearchPanes
- Improved bubble editing positioning while the page is scrolling
- Support for Bootstrap 5's floating labels
- Rewritten Typescript definition files
Historic blog posts
- Vue3 component 22nd Jun 2022
- RequireJS anyone? 20th Jun 2022
- DataTables 1.12 13th May 2022
- Social Media for DataTables and CloudTables 14th Feb 2022
- Introducing StateRestore 26th Nov 2021
- Fuzzy Search Plug-in 17th Sep 2021
- Cascading lists in Editor (part 2!) 8th Jul 2021
- Bootstrap 5 and Bulma styling 10th Jun 2021
- Type Detection Library 17th May 2021
- Internationalisation Contributions 9th Apr 2021
- Editor 2 9th Mar 2021
- Bootstrapped Podcast 29th Jan 2021
- Highcharts Integration 1st Oct 2020
- Introducing SearchBuilder 15th Sep 2020
- Editor QR Scanner Integration 10th Jul 2020
- Introducing CloudTables 1st Jun 2020
- Using Editor's libraries for server-side processing 12th May 2020
- SearchPanes Release 13th Jan 2020
- RowGroup Tricks and Tips 5th Jan 2020
- October releases - 2019 2nd Oct 2019
- DataTables download statistics - 2019 29th Jul 2019
- Scroll To Top 21st Jun 2019
- Refreshing data before editing 15th Apr 2019
- Installing Editor in WordPress 15th Feb 2019
- Parent / child editing in child rows 11th Jan 2019
- Debugger update 12th Jul 2018
- SearchFade 8th May 2018
- Vertical scroll fitting 31st Dec 2017
- Experiment: SearchPane 30th Nov 2017
- Queuing changes in Editor 24th Oct 2017
- Cascading lists in Editor 1st Sep 2017
- Editor and NPM 31st Aug 2017
- Deep linking into DataTables 24th Jul 2017
- Always visible editing panel 30th Jun 2017
- Iterators in DataTables 31st May 2017
- RowGroup - new extension 7th Apr 2017
- Ajax loaded row details 31st Mar 2017
- Locale based sorting 28th Feb 2017
- Search highlighting with mark.js 19th Jan 2017
- Sorting with absolute positioned data 23rd Dec 2016
- Editor 1.6 16th Dec 2016
- Dynamic enum sorting 16th Jun 2016
- Spring updates - 2016 24th May 2016
- Parent / child editing with Editor 25th Mar 2016
- Ellipsis renderer 26th Feb 2016
- Generator update 21st Jan 2016
- Download statistics 31st Dec 2015
- NPM and Bower 9th Nov 2015
- Editor's server-side events 2nd Oct 2015
- Multi-row bulk editing 11th Sep 2015
- Update extravaganza 13th Aug 2015
- Git repo structure update 2nd Jun 2015
- DataTables 1.10.7 30th Apr 2015
- Vertical page fitting 10th Apr 2015
- Editor 1.4 / DataTables 1.10.5 12th Feb 2015
- Ultimate date / time sorting plug-in 18th Dec 2014
- Editor 1.4 beta - .NET 4th Dec 2014
- Table captions 7th Nov 2014
- Search result highlighting 22nd Oct 2014
- DataTables 1.10.3 9th Oct 2014
- Sliding child rows 2nd Oct 2014
- Alphabet input search - Part III 22nd Sep 2014
- Permanent inline checkboxes 9th Sep 2014
- Alphabet input search - Part II 2nd Sep 2014
- Alphabet input search - Part I 26th Aug 2014
- Business: UK VAT exchange rates 8th Aug 2014
- Duplicate buttons in Editor 25th Jul 2014
- Introducing Responsive for DataTables 16th Jul 2014
- DataTables 1.10.1, Editor 1.3.2 and more 15th Jul 2014
- Nominet Internet Awards shortlist 17th Jun 2014
- Font Awesome integration 6th Jun 2014
- Support and forums updates 26th May 2014
- DataTables 1.10.0 released 1st May 2014
- DataTables 1.10.0 release candidate 25th Apr 2014
- DataTables 1.10 beta 4th Feb 2014
- HTML 5 Clipboard and File APIs 31st Jan 2014
- JS Bin update 24th Jan 2014
- Orthogonal data 9th Jul 2012
- Inline editing 31st May 2012
- Introducing Editor 4th May 2012
- DataTables debugger 26th Feb 2012
- Twitter Bootstrap 2 1st Feb 2012
- Microsoft CDN 28th Jan 2012
- localStorage for state saving 16th Jan 2012
- Twitter Bootstrap 8th Dec 2011
- Site updates - JS Bin and more 1st Nov 2011
- Getting started with DataTables 27th Aug 2011
- DataTables support 29th Jun 2011
- Drill-down rows 19th Jun 2011
- Introducing Scroller 11th Jun 2011
- DataTables 1.8 4th Jun 2011
- Creating beautiful and functional tables with DataTables 10th May 2011
- Extended data source options with DataTables 1st May 2011