mRender called multiple times

mRender called multiple times

silverjp1silverjp1 Posts: 2Questions: 0Answers: 0
edited April 2013 in DataTables 1.9
Hi
can someone explain to me why the function defined for the mRender property is
called multiple times per row?
As you can see here:
http://jsfiddle.net/6JCH2/13/

fnRowCallback and fnCreatedCell are called the exact number of times (3) while
the function defined by mRender is called multiple times per row

I was using fnRender for this and it was functioning as expected, am I doing something wrong?

Thanks

Replies

  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    Yes, it is called multiple times because it can be used to get different data types (i.e. sort, filter, display etc data). It is intentional that mRender will be called whenever DataTables needs some data from your data source.

    Allan
  • silverjp1silverjp1 Posts: 2Questions: 0Answers: 0
    Thanks for the quick reply, which has been really helpful.
    Adding sType:'string', bSearchable:false , bSortable:false solved the problem
    also removed fnCreatedCell (which was added only for debugging) and added one call

    http://jsfiddle.net/6JCH2/14/

    Thanks, again.
This discussion has been closed.