Working on filtered set

Working on filtered set

shashankyshashanky Posts: 3Questions: 0Answers: 0
edited June 2011 in General
Hi Allan,
I want work on the filtered set of data rows but am unable to find a way to do that. fnGetNodes returns all the nodes. The scenario in my case is that I have a checkbox column in each row and also on in the header (for select all). The user can either individually check the rows but if they want to select all then they can click on the checkbox in the header. So, I want to detect the rows which are currently visible through and mark all of them as checked.

Is there a way to do it?
Thanks.

Replies

  • shashankyshashanky Posts: 3Questions: 0Answers: 0
    I got the solution... the function to use is the API plugin fnGetDisplayNodes. It gives all the displayed rows and then I can mark them as checked or unchecked depending on the action on the select all checkbox.
  • NJDave71NJDave71 Posts: 40Questions: 3Answers: 0
    I have 4000 records total in my table. The user enters 10/1/2011 and now there are 100 filtered records 10 per page. The user clicks the Check All option and the checkboxes get checked. i am using AJAX to update the database. Instead of getting 100 records it only handles the 10 records.

    At First I used fnGetNodes in my #check_all and it checked everything. From what I understand this is what is initially returned without a filter. So I tried fnGetDisplayNodes.

    How can check off just the 100 records and loop through the 100 records?

    [code]

    $('#check_all').click(function () {
    $('input', oTable.fnGetNodes ()).attr('checked', this.checked);
    });

    $('#btnrenew').click(function () {
    $("input:checked", oTable.fnGetDisplayNodes()).each(function () {
    console.log($(this).val());
    });
    return false;
    });
    [/code]

    Thanks and hope this is clear
  • NJDave71NJDave71 Posts: 40Questions: 3Answers: 0
    It works now uisng below.

    [code]
    $.fn.dataTableExt.oApi.fnGetFilteredNodes = function ( oSettings )
    {
    var anRows = [];
    for ( var i=0, iLen=oSettings.aiDisplay.length ; i
  • killerangel73killerangel73 Posts: 1Questions: 0Answers: 0
    Hi,
    I implemented the code to check all the filtered rows, but it filters out only those that are on the first page and not the remaining sulel other pages you can give me a hand to solve the problem?
    thanks
This discussion has been closed.