why mRender loops twice?

why mRender loops twice?

macmacmacmac Posts: 4Questions: 0Answers: 0
edited May 2013 in Bug reports
Hi All, I have the following code.
[code]
mRender: function(source, type, val) {
console.log(val);
}
[/code]

How come I get redundant result for this?

val parameter gives me 5 arrays, when I log it, it becomes 10 arrays.

Anyone knows why?
Thanks
Mac

Replies

  • allanallan Posts: 63,682Questions: 1Answers: 10,498 Site admin
    mRender is called multiple times - sorting, filtering, type detection and display all pass through it so different data can be used for each. That's why :-)

    Allan
  • macmacmacmac Posts: 4Questions: 0Answers: 0
    edited May 2013
    Hi Allan,

    Thanks for replying. One last thing if return something using mRender, will it also return twice or multiple times?

    Thanks a lot
    Mac
  • allanallan Posts: 63,682Questions: 1Answers: 10,498 Site admin
    Well, mRender is called multiple times. So it will return something every time it is called.

    Allan
  • macmacmacmac Posts: 4Questions: 0Answers: 0
    edited May 2013
    I get it, the reason I'm getting 1 item in return is it overwrites it's previous return. Thanks Allan. I'm very new to datatables. Appreciate your help.
This discussion has been closed.