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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:23:03+00:00 2026-05-27T00:23:03+00:00

I am using datatables in my application. Whenever user click on any row I

  • 0

I am using datatables in my application. Whenever user click on any row I want to highlight it and pick some values from selected row.

"oTableTools": {
               "sRowSelect": "single",

               "fnRowSelected": function ( node ) {
                   var s=$(node).children();
                       alert("Selected Row : " + $s[0]);
                   }

I tried sRowSelect and fnRowSelected but no luck. The row is not highlighted and neither fnRowSelected is called. Even no error on console.

Here is my complete code

  var userTable = $('#users').dataTable({
            "bPaginate": true,
            "bScrollCollapse": true,
            "iDisplayLength": 10,
            "bFilter": false,
            "bJQueryUI": true,
            "sPaginationType": "full_numbers",
            "oLanguage": {
                "sLengthMenu": "Display _MENU_ records per page",
                "sZeroRecords": "Enter a string and click on search",
                "sInfo": "Showing _START_ to _END_ of _TOTAL_ results",
                "sInfoEmpty": "Showing 0 to 0 of 0 results",
                "sInfoFiltered": "(filtered from _MAX_ total results)"
            },
            "aaSorting": [[ 0, "asc" ]],
            "aoColumns": [/* Name */ null,
                          /*Institution*/null,
                          /*Email*/null],
           "oTableTools": {
               "sRowSelect": "single",

               "fnRowSelected": function ( node ) {
                 alert("Clicked");
                   }
           }       
        });    

Am I missing anything ?

EDIT:
Now able to highlight selected row.Added class=”display” to HTML table. Still wondering why I didn’t find this in datatable docs. Now looking how to collect selected values.

  • 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-27T00:23:03+00:00Added an answer on May 27, 2026 at 12:23 am

    Here is how I do it

    just add this function to your page (if users is your table id)

    $("#users tbody").delegate("tr", "click", function() {
    var iPos = userTable.fnGetPosition( this );
    if(iPos!=null){
        //couple of example on what can be done with the clicked row...
        var aData = userTable.fnGetData( iPos );//get data of the clicked row
        var iId = aData[1];//get column data of the row
        userTable.fnDeleteRow(iPos);//delete row
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jQuery datatables in a asp mvc application, and I want to
Using .Net and Oracle 11g - I've been returning dataTables from a procedure inside
I want to remove duplicates from my DataTable so I'm using DataTable.AsEnumerable().Distinct(DataRowComparer.Default) but it
I'm using jQuery DataTables in my .NET web application but how do I set
I am using jquery datatables serverside in my MVC application. When I put a
I am using the jQuery DataTables plugin in my application and am displaying a
We are converting our application from using Sql Server Express (let's call this version
I am using a Windows application and I export a datatable into an Excel
I have started using the DataTables plugin (v1.6.2) for jQuery (v1.4.2), and I would
I am using the jQuery DataTables plugin. I would like to move the search

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.