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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:36:35+00:00 2026-06-12T23:36:35+00:00

Seems like it should be easy but… Does anyone know how to return the

  • 0

Seems like it should be easy but…

Does anyone know how to return the current rows from a filtered dataTable? The oTable.fnGetNodes() method returns all rows, where I just want the filtered (visible, but including paginated) ones

// filter on division
var oTable = $('#summary-table').dataTable();
oTable.fnFilter(division_text, 2, true);

// Get the nodes from the table  
var nNodes = oTable.fnGetNodes(); // <-- still retrieves original list of rows

I checked: Retrieving visible data from Datatables but not much help there.

  • 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-12T23:36:36+00:00Added an answer on June 12, 2026 at 11:36 pm

    Figured out the answer, if anyone ever needs this:

    First, using this datatables extension to get all the hidden rows:

    $.fn.dataTableExt.oApi.fnGetHiddenTrNodes = function (oSettings, arg1, arg2) {
    
    /* Note the use of a DataTables 'private' function thought the 'oApi' object */
    
    var anNodes = this.oApi._fnGetTrNodes(oSettings);
    var anDisplay = $('tbody tr', oSettings.nTable);
    
    /* Remove nodes which are being displayed */
    for (var i = 0; i < anDisplay.length; i++) {
        var iIndex = jQuery.inArray(anDisplay[i], anNodes);
    
        if (iIndex != -1) {
            anNodes.splice(iIndex, 1);
        }
    }
    
    /* Fire back the array to the caller */
    return anNodes;
    }
    

    Then filter out the hidden nodes to get only visible nodes:

     var rows = oTable.fnGetNodes(); // get all nodes            
     var rows_hidden = oTable.fnGetHiddenTrNodes(); // get all hidden nodes
    
     var result = [], found;
    
     // remove hidden nodes from all nodes
     for (var i = 0; i < rows.length; i++) {
      found = false;
        for (var j = 0; j < rows_hidden.length; j++) {
          if (rows[i] == rows_hidden[j]) {
            found = true;
              break;
                    }
                }
                if (!found) {
                    result.push(rows[i]); 
                }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems like it should be really easy but I couln't find an answer
This seems like it should be easy, but I can't quite find an explanation
This seems like it should be an easy thing to do, but for the
This seems like it should be something very easy to do, but every time
This seems like it should be easy but i've spent way too much time
This seems like it should be easy enough, but I'm having trouble in what
Seems like this should be easy, but I'm not finding a simple configuration setting.
It seems like this should be easy, but I'm no expert and google isn't
This seems like it should be so easy, but I am getting an exception
This seems like it should be an easy fix, but after searching for hours

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.