search work only selected rows

search work only selected rows

rohit99rohit99 Posts: 22Questions: 9Answers: 0

datatable search work only selected rows

Answers

  • rohit99rohit99 Posts: 22Questions: 9Answers: 0

    datatable search only checked rows. we use custom filter

    var _table = $('#tblFlowdown').DataTable();

            _table.columns(col).search('\\b' + txt, true).draw();
    
            $.fn.dataTable.ext.search.push(
               function (settings, data, dataIndex) {
                    if (($(_table.row(dataIndex).node()).hasClass('expFlowDown-selected'))) {
                       return true;
                   } else {
                        return false;
                    }
                }
            );
            _table.columns(col).search('\\b' + txt, true).draw();
            $.fn.dataTable.ext.search.pop();
    

    but not work fine

  • rf1234rf1234 Posts: 2,806Questions: 85Answers: 406

    "but not work fine"
    Could you be slightly more specific about the issue that you have. Many thanks!

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Ideally with a link to a test case showing the issue please.

    Allan

This discussion has been closed.