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 9125655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:51:15+00:00 2026-06-17T06:51:15+00:00

Ok I am trying to dynamically add new rows to a already rendered table

  • 0

Ok I am trying to dynamically add new rows to a already rendered table using datatables. Thus far what I have is

oTable.fnAddData(["D:\Exlab", '[<a href="#" class="datasource_row_edit" data-idr="reference">Edit</a>] [<a href="#" class="datasource_row_delete" data-idr="reference">Delete</a>]']);

Which this works for adding a single row (if anyone knows how to use a similar function to add multiple rows without running a loop that would be bonus). However I want to have a specific column in this case the second column have a special class, is there a means of adding a class to a column thats being added on the fly?

  • 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-06-17T06:51:16+00:00Added an answer on June 17, 2026 at 6:51 am

    I think you could accomplish this by controlling the column definitions and assigning the class via fnRender. After your columns are defined, feed the fnAddData function some data.

    Here is a similar SO questions.. CLICK HERE that I think you would find useful.

    In your case, I think that the column definitions would look something like this

    ...
        "aoColumns": [
                {   
                    "sClass": "datasource_row_edit",
                    "fnRender": function( oObj ) {
                        return '<a href="#" data-idr="reference">Edit</a>';
                    } 
                },
                {  
                  "sClass": "datasource_row_delete",
                   "fnRender": function( oObj ) {
                        return '<a href="#" data-idr="reference">Delete</a>';
                    } 
                }
            ],
    ...
    

    Via their api .. http://www.datatables.net/api … You could feed the table any number of rows via json

    var json = eval("[" + response + "]");
    oTable.fnAddData(json);
    

    and let the datatable render any formatting itself dynamically

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

Sidebar

Related Questions

I'm trying to add rows dynamically to a System.Web.UI.WebControls.Table control in ASP.NET. I found
I'm trying to dynamically add properties to Azure Table Storage using the ReadingEntity and
I have been researching the JQuery way to add table rows dynamically. One excellent
I am trying to get a new dynamically created row to add to a
I'm trying to get an understanding of how to dynamically add columns and rows
I am trying to dynamically (using reflection) add types to a MEF catalog and
Summary: Trying to dynamically add heading rows to a ListView via a custom adapter
I am trying to dynamically add items to a list adapter using an alert
I have the following bit of code. I'm trying to dynamically add drop-down options
I am trying to add new Elements in an HTML page body by using

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.