Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6764903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:38:56+00:00 2026-05-26T14:38:56+00:00

I am trying to make a page with a table enhanced with the DataTables

  • 0

I am trying to make a page with a table enhanced with the DataTables plugin, where a user can add new rows via a separate form.

Using the API, this was relatively simple to do:


$('#table').dataTable().fnAddData( [
data.content.notes,
data.content.date,
data.content.name,
amount.toFixed(2),
deleteButton
]);

However, if the table is sorted and pagination is enabled, then the inserted row might end up in a page other than the currently selected one. Which is a bit of a pain, because even with a proper success message near the ‘add’ button, I still think that the users will get confused.

So my solution to this is: add a new row, then change the current page to the page where the row has been inserted, then briefly highlight the row.

Any ideas on how to find out on what page the row has been inserted? 🙂

Thanks,
Alex

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:38:57+00:00Added an answer on May 26, 2026 at 2:38 pm

    Why don’t you try the fnAddDataAndDisplay() plugin on the plugin API page?

    Add a new row to the table and display it on the screen by jumping the pagination to the required location. This function also returns an object with the added TR element and it’s index in aoData such that you could provide an effect (fade for example) to show which row has been added.

    \Edit – somebody else asked exactly the same question on their forums

    ~Cyrix

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a form that the allows the user to add or
I'm trying to make a page in php that takes rows from a database,
I'm trying to make it so that a form submit doesn't cause the page
Trying to make a make generic select control that I can dynamically add elements
I am trying to make a table-like calendar page, using fixed width and height
I'm trying to make a table that stretches 100% of the page (or whatever
I'm trying to make a multi-countdown on a page, which looks like : <table>
I'm new to J2ME and I was trying to make a page which has
I'm trying to make a dynamic table with PHP. I have a page which
I'm trying to make the rows of this table start out disabled and then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.