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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:10:43+00:00 2026-05-25T12:10:43+00:00

I have a jquery datatable that contains name and count data. <tr> <th>Name</th> <th

  • 0

I have a jquery datatable that contains name and count data.

                <tr>
                    <th>Name</th>
                    <th class="count">Count</th>
                </tr>
              </thead>
            <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>               
              <td class= "name"><%# Eval("Name") %></td>
              <td class= "count"><%# Eval("count") %></td>             
            </tr>

The issue i am facing is trying to retrieve data that matches a certain criteria based on 2 selectors. For instance, how would i write a jquery function to retrieve names that are “john” and have a count of 4? I am able to retrieve positions where all names that are john as follows:

 $('td').each(function () {        
         var aPos = oTable.fnGetPosition(this);
         var aData = oTable.fnGetData(aPos[0]);
         var retrievedEntry = aData[aPos[1]];

         if (retrievedEntry == "john") {
             alert($(this).html() + "found at position " + aPos);
         }
 });

I tried alert($(this).find(".count").filter(":contains("1")")); as a test but keep getting null values.

Also once the data is retrieved, how would i delete all the duplicates and jus leave one record? Your help is much appreciated.

  • 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-25T12:10:44+00:00Added an answer on May 25, 2026 at 12:10 pm

    You can get the cells that contain “john”, and then filter that result to only contain the ones that have “4” in the next element:

    $('td.name:contains(john)').filter(function(){ return $(this).next().text() == '4'; })
    

    Note: The :contains selector makes a partial match, so it would also match for example “johnny”. If that is a problem, you would put that check in the filter also:

    $('td.name').filter(function(){ return $(this).text() == 'john' && $(this).next().text() == '4'; })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the jquery datatable plugin. I have the following code that sets
I have a jQuery datatable(outlined in red), but what happens is that the table
I have a large amount of data I wish to use with Jquery DataTable
I have the following jQuery call that correctly creates and loads a DataTable on
I am using JQuery with the DataTable plugin, and now I have a big
I have jQuery code which looks something like this on Button1 Click $('table.result_grid tbody
I have jQuery to select all font elements that are children of the element
Say I have jquery code like this: html += '<div class=index>' + item.index +
I am trying to implement a function on jquery datatable, that returns the 1st
i want to show my input data from DB...i'm interest for using jquery dataTable...

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.