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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:06:42+00:00 2026-06-11T02:06:42+00:00

I am new to Jquery Datatables. I have managed to create a table and

  • 0

I am new to Jquery Datatables. I have managed to create a table and add some elements into it.
This is What I have got.

I want to trigger the mouse click events on the hyperlinks in my table and retrieve the data in the data table of certain row. Such as “blockid” of clicked hyperlink’s row. How can I do it?

Please advice. Thanks!

$(function () {
 $('#tbl_datablocks').dataTable( {
      "aoColumns": [
          { "sTitle": "blockid","sName": "blockid"},
          { "sTitle": "Name" },
          { "sTitle": "Created Time" },
          { "sTitle": "Updated Time", "sClass": "center" },
          { "sTitle": "Updated Time", "sClass": "center" }
          ]    } );


$('#tbl_datablocks').dataTable().fnAddData(["id1","data1","data2","data3","<a href='#' class='retrievedata' onclick='retrievedata(this)'>Read</a>"]);
$('#tbl_datablocks').dataTable().fnAddData(["id2","data1","data2","data3","<a href='#' class='retrievedata' onclick='retrievedata(this)'>Read</a>"]);
});   

function retrievedata(which)
{
    alert($(which).parents("tr"));
}
​
  • 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-11T02:06:43+00:00Added an answer on June 11, 2026 at 2:06 am

    Have you considered using the data attributes? When creating your anchor <a>, add an attribute data-blockid with the correct value. When jQuery registers the click event, you can use $(this).data("blockid") to get the value.

    Here’s an updated example

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

Sidebar

Related Questions

I have built a function using jQuery to insert into a table a new
I am fairly new to jQuery and JSON and have run into a problem
are there any way to add new column to the table with JQuery plugin
I have been looking for some examples and solutions using the jquery-datatables-editable plugin and
I'm pretty new to JQuery Datatables, I'm attempting to retrieve two information about the
I'm new to jQuery dataTables and I'm overwhelmed. But now using it in a
I have application that brings response via Ajax and creates 5-20 new jQuery click
Example: var $doesNotYetExistInTheDOM = $('<span/>'); // create new jQuery element // outside of the
im new to jquery and javascript.. Here is the code, this is a sample,
I am new to jQuery. I have PrimeFaces dataTable. when it is converted to

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.