Skip to content
-
Mind and Script Mind and Script Mind and Script

Deep Thoughts, Clean Thoughts

Mind and Script Mind and Script Mind and Script

Deep Thoughts, Clean Thoughts

  • Home
  • Life
    • Lifestyle
    • Mental Health
    • Personal Growth
    • Philosophy
    • Professional Growth
    • Psychology
  • Books
  • Writing
    • AI Writing
    • Technical Writing
  • Movies
  • Travel
    • Day Trips
    • Food
    • Itineraries
    • World
  • Technology
  • Home
  • Life
    • Lifestyle
    • Mental Health
    • Personal Growth
    • Philosophy
    • Professional Growth
    • Psychology
  • Books
  • Writing
    • AI Writing
    • Technical Writing
  • Movies
  • Travel
    • Day Trips
    • Food
    • Itineraries
    • World
  • Technology
Close

Search

Mind and Script Mind and Script Mind and Script

Deep Thoughts, Clean Thoughts

Mind and Script Mind and Script Mind and Script

Deep Thoughts, Clean Thoughts

  • Home
  • Life
    • Lifestyle
    • Mental Health
    • Personal Growth
    • Philosophy
    • Professional Growth
    • Psychology
  • Books
  • Writing
    • AI Writing
    • Technical Writing
  • Movies
  • Travel
    • Day Trips
    • Food
    • Itineraries
    • World
  • Technology
  • Home
  • Life
    • Lifestyle
    • Mental Health
    • Personal Growth
    • Philosophy
    • Professional Growth
    • Psychology
  • Books
  • Writing
    • AI Writing
    • Technical Writing
  • Movies
  • Travel
    • Day Trips
    • Food
    • Itineraries
    • World
  • Technology
Close

Search

DataTables Usage with AJAX (Create and Update Table)

August 6, 2018 2 Min Read
0

This post guides you through the complete implementation of DataTable, from initializing the DataTable to updating the data in the table. It includes instructions on how to connect your API to get the data for the table.

You can find the DataTable Docs here. But I was unable to get the exact things which I was trying to do. Plus I found the reference docs of DataTable a bit confusing.

So, here is a simple process to use DataTables using your own API to create a Table with AJAX.

Initialization of DataTable:

This will create a table onLoad with the Data from the API, initializing DataTable.

HTML for the Table:

1*hCC13lg2tpVO0Ak9dOilYA
HTML for rendering the Table and data will be populated here.

Note:: class and style used are as per my requirements. You can add your own classes and styles as per your requirement.

Updating the Table and Reinitialize the DataTable

If you have filters that can be used to filter out the data shown in the table, you can add this script to your code.

1*Yowlj1pC2Sle0bEHg8u XA
On click of Filter button, update your table with new Data.

If you want to try out the code, here is the JSFiddle of the code.

Feel free to provide your feedback or any corrections if required.

💡 Mind and Script Weekly

Join other engineers and writers. No spam, just substance.

Disclaimer: This post may contain affiliate links. If you click and buy, we may receive a small commission at no extra cost to you. Read our full disclosure here.

Tags:

AJAXDataTablesHTMLJavaScript
Author

Rajesh Mishra

I'm a developer who loves sharing insights, technical how-tos, and lessons learned from the world of code. While much of what I write may not be groundbreaking, I believe in documenting for future me—and for anyone else who might find it useful. Beyond tech, I also dive into life's experiences and moments, reflecting on personal growth and sharing stories that resonate. Whether you're here for practical tips or a fresh perspective on life, I hope you find something meaningful.

Follow Me
Other Articles
Previous

How I Found the Love of my Life

Next

Dynamically Add or Remove Fields using jQuery or JavaScript

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Hyderabad Traffic
  • 5 Best Books to Read After a Breakup
  • 5 Movies to Stream This Valentine’s Day If You’re Single
  • Self-Care: A Guide to Solo Valentine’s Day
  • Using GitHub Actions for Google Cloud Run

Recent Comments

  1. Sneha on Smartphones: Friend or Foe?

Important Links

  • Affiliate Disclosure
  • Privacy Policy
  • Terms of Use
© Copyright 2026 — Mind and Script. All rights reserved.