One of the typical SharePoint customizations is to display SharePoint List data in jQuery Datable. We used to develop this using the content editor web part or custom page referencing custom JS file. With a new development-recommended approach to create client-side web parts using SharePoint framework, let us see how we can achieve the same using SharePoint Framework web part.
If you are not familiar or aware of SPFx web part and jQuery data table, I would request you to go through below links first.
Sample List
Create a list as per our requirement. For this article, we would be using the below list.

Create an SPFx web part, use the below options.

jQuery Packages
Add the jQuery packages. Run the below 2 commands one by one in NodeJS command prompt at the project root directory.
- npm install @types/jquery@2 --save
- npm install @types/jqueryui --save
DataTable Packages
As the purpose of the article is to use jQuery Datatable to render list data, we would need to install the data table npm packages in our solution. As we are in luck, we do have npm packages available for datatable.net library which can be used in any node.js based project/solution. Here, we are using jQuery UI front-end framework, we can also use other front-end frameworks like bootstrap, semantic. Read more about this in details at this link.
- npm install datatables.net
- npm install datatables.net-jqui
- npm install --save @types/datatables.net
Last command is to install datatable type which can be used in TypeScript, without this there is an indirect way to use data tables methods in TypeScript (which is a story not for today)
Now, we have our required packages installed, let us move to actual code.
Open SPFx solution in your favourite code editor and go to '\js-jquery-datatable\src\webparts\jqueryDataTableWp\JqueryDataTableWpWebPart.ts' .
Import Packages
Add the below lines on top of your webpart.ts file to import packages which we installed.
- import { SPComponentLoader } from '@microsoft/sp-loader';
- import * as $ from 'jquery';
- import 'DataTables.net';
- import { SPHttpClient, SPHttpClientResponse, ISPHttpClientOptions} from '@microsoft/sp-http';
Note
The first and the last import statement do not need any packages to be installed because the packages are already available as a part of SharePoint package while we created SPFx solution using the yo @microsoft/SharePoint command. SPComponentLoader will be used for loading external JS/CSS file. SPHttpClient package has methods which we can use to interact with SharePoint using REST API.
The first and the last import statement do not need any packages to be installed because the packages are already available as a part of SharePoint package while we created SPFx solution using the yo @microsoft/SharePoint command. SPComponentLoader will be used for loading external JS/CSS file. SPHttpClient package has methods which we can use to interact with SharePoint using REST API.
Render Method
Replace render method with below. Please read comments in code carefully to understand the logic behind getting data and initializing DataTable with the JavaScript object (returned from REST API call).
Rest API used to get the list data.
- /_api/web/Lists/GetByTitle('CustomList')/items?$select=ID,Title,Email,Phone,Status,yes_x0020_no


MamtaPosted Jun 6, 2025, 1:26 PM
CSS not Working on Pagination
Avinash YerraPosted May 12, 2022, 10:35 AM
Hi Siddharth, I am able to compile and deploy the code on SharePoint online. However, no data is shown on the page when I add the web part. There are no errors. I have created the list same as the one you have created
David JonesPosted Feb 4, 2021, 10:45 PM
Siddharth Vaghasia this is a great reference, thanks. Can you provide any guidance how to incorporate a column search bar for each field? We have one search bar for the full list but I know Datatables.net reference column specific search filters however I can't get them to work in this solution, any ideas? :) Thanks!
Abenet BeyenePosted Sep 29, 2020, 11:35 AM
Have you did date column from list and have standard format ? I am having issue converting from utc to standard.
Divesh GuptaPosted May 4, 2020, 10:15 AM
Hey! I am able to compile and deploy the code on SharePoint online. However, no data is shown on the page when i add the webpart. There are no errors. Please suggest
Abenet BeyenePosted Jan 22, 2020, 12:45 AM
Hi Siddharth, have you used child row? https://datatables.net/examples/api/row_details.html
Siddharth VaghasiaPosted Jan 11, 2020, 10:34 PM
Yes....it is possible... use jquery datatable render function with column definition...https://datatables.net/reference/option/columns.render... on this page if you go down you will find "Use as a function to create a link from the data source:"
Abenet BeyenePosted Jan 9, 2020, 8:30 PM
Is it possible to have an item to have hyperlinks. For instance all rows under title to be hyperlinks?