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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:14:48+00:00 2026-06-13T12:14:48+00:00

I followed this post: DataTable: Server Side Processing in ASP.Net I am using this

  • 0

I followed this post: DataTable: Server Side Processing in ASP.Net
I am using this code to initialize DataTable:

<script type="text/javascript">
    $(function () {
        $('#example').dataTable({
            'bProcessing': true,
            'bServerSide': true,
            'sAjaxSource': '/data.ashx'
        });
    });
</script>

My JSON is something like this:

{    
 "iTotalRecords": "57",
 "iTotalDisplayRecords": "57",
 "aaData": [
  [
     "id001",
     "Name001",
     "Addr001",
  ],
  [
     "id002",
     "Name002",
     "Addr002",
   ]
  ]
}

I want to achieve same as below:

<table id="datatable">
   <thead>...</thead>
   <tbody>
     <tr id="id001">
        <td>Name001</td>
        <td>Addr001</td>
     </tr>
     <tr id="id002">
        <td>Name002</td>
        <td>Addr002</td>
     </tr>

     .
     .
   </tbody>
 </table>

NOTE:
To assign the id to <tr> I am using:

"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull) {
     $(nRow).attr("id",aData[0]);
     return nRow;
}

But it is not hiding the ID column.
Please help.

Update:
I found a perfect solution for my problem.
I must create my JSON as below

 {    
 "iTotalRecords": "57",
 "iTotalDisplayRecords": "57",
 "aaData": [
  [         
     "0":"Name001",
     "1":"Addr001",
     "DT_RowId": "id001",
  ],
  [        
     "0":"Name002",
     "1":"Addr002",
     "DT_RowId": "id002",
   ]
  ]
}

For more information check this link: DateTable – automatic row ID addition

  • 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-13T12:14:50+00:00Added an answer on June 13, 2026 at 12:14 pm

    Use aoColumnDefs to hide a column. Datatables example

    $('#datatable').dataTable({
        aaData: aaData,
        "fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
            //console.log(nRow);
    
            $(nRow).attr("id", aData[0]);
            return nRow;
        },
        "aoColumnDefs": [
            {
            "bSearchable": false,
            "bVisible": false,
            "aTargets": [0]
            },
        ]
    });​
    

    Working fiddle

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

Sidebar

Related Questions

I followed this post: DataTable using Server Side Processing . Inside default.aspx , I
I followed this post http://neurochannels.blogspot.com/2010/05/how-to-run-r-code-in-matlab.html , to install R(D)Com server in order to call
I followed this tutorial to create a sample Login application using ASP.NET MVC I
I followed the directions in this post: how can we integrate jquery autocomplete using
This is my first time using authentication library. I followed this post to install
I read this post: What is the easiest-to-use web "rich text editor" and followed
I followed this post to make my section header animate out of view when
I followed the instructions in this post and this fiddle but I am confused
I'm trying to upgrade to Node v0.6.17. I followed the instructions in this post:
I followed this video tutorial for detecting memory leaks using Instruments with Xcode 4.3.2.

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.