How to get all filtered rows

How to get all filtered rows

emepycemepyc Posts: 8Questions: 2Answers: 0
edited November 2012 in General
Hi all,

I want to iterate over all the filtered rows of a table to change the value of a column.
Basically I want to do something like:

[code]
new_value = "Ok";
column_index = 4;
$.each(oTable._('tr', {"filter":"applied"}), function(i,v) {
var aPos = oTable.fnGetPosition(v);
console.log("ROW POSITION: " + aPos);
oTable.fnUpdate(new_value, aPos, column_index);
});
[/code]

But it seems that I can't get fnGetPosition from v:
"Uncaught TypeError: Cannot call method 'toUpperCase' of undefined"

Any ideas?

Replies

  • allanallan Posts: 63,528Questions: 1Answers: 10,473 Site admin
    edited November 2012
    [code]
    oTable.$('tr', {"filter":"applied"}).each( function () {
    oTable.fnUpdate( new_value, this, column_index );
    } );
    [/code]

    :-)

    Allan
  • emepycemepyc Posts: 8Questions: 2Answers: 0
    Solved. I was looking for the dollar ($) instead of underscore (_) method.
  • emepycemepyc Posts: 8Questions: 2Answers: 0
    Hi Allan,
    I didn't see your answer before and had an instructive RTFM moment.
    Thanks for the prompt reply!

    Cheers,

    M;
This discussion has been closed.