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

  • Home
  • SEARCH
  • 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 915127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:50:06+00:00 2026-05-15T17:50:06+00:00

i have a data table..but it can’t select one row after click the row..

  • 0

i have a data table..but it can’t select one row after click the row..
can you tell me where the mistake??

oTable = $("#datalist").dataTable({
                                   "bRetrieve"  : true,
                                   "bServerSide": true,
                                   "bProcessing": true,
                                   "sAjaxSource": 'showlist.php',
                                   "fnServerData": function (sSource,aoData,fnCallback){
                        aoData.push({"name":"line","value":$("#showline").val()});
                        aoData.push({"name":"model","value":$("#showmodel").val()});
                        aoData.push({"name":"serial","value":$("#serial").val()});
                        aoData.push({"name":"NIK","value":$("#showNIK").val()});
                        $.ajax({
                                "dataType":'json',
                                "type":'POST',
                                "url":sSource,
                                "data":aoData,
                                "success":function(json){
                                                fnCallback(json);
                                                }
                                });
                        },
                               "aaSorting"  : [[1,"desc"]],
                               "aoColumns"  : [
                                              /*Line*/  null,
                                             /*Model*/ null,
                                            /*Serial*/null,
                                            /*NIK*/   null
                                             ]
                 });
                 }else{
                      oTable.fnDraw();
                       }

              });

              function fnGetSelected( oTableLocal ) {
                        var aReturn = new Array();
                        var aTrs = oTableLocal.fnGetNodes();
                        for ( var i=0 ; i<aTrs.length ; i++ )
                        {
                          if ( $(aTrs[i]).hasClass('row_selected') )
                          {
                           aReturn.push( aTrs[i] );
                           }
                        }
                        return aReturn;
                }
  • 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-15T17:50:08+00:00Added an answer on May 15, 2026 at 5:50 pm

    I don’t know exactly how it is supposed to fit into your code, and your question needs more fleshing out, but I suppose you could select the row next to the clicked one like this:

    $("#datalist > tr").click(function() {
        $(this).next("tr").addClass('row_selected');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have data source and table that I can bind to my controls and
Hii, I have a data table, and this datatable will be dynamically manipulated. After
I have a data table with alternating row background colors. I have an AJAX
How can I select average of multiple columns? Suppose I have some data like:
I have data from a table in a database (string) that contain text and
I have to delete some rows from a data table. I've heard that it
Hi I have following data in the table: ID-----startDate----endDate 5549 2008-05-01 4712-12-31 5567 2008-04-17
I have a two-dimensional array (of Strings) which make up my data table (of
I have a small app/site on a dev server with a data table in
Greetings, I have data stored on mysql with delimiter , in 1 table. I

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.