What are the types used by 'render' used for?

What are the types used by 'render' used for?

traffictraffic Posts: 3Questions: 2Answers: 0

In the columns.render documentation the render function template is 'render(data,type,row,meta)'
From the documentation:
The type call data requested - this will be 'filter', 'display', 'type' or 'sort'.

I suggest a slight rewording of this:

The type or format for data requested - this will be 'filter', 'display', 'type' or 'sort'..
display: used as the table cell displayed information
filter: used when doing a search operation (see: colums.search)
type: magic... ????
sort: used when sorting (see: ????)

This issue came up when I was doing sorting of a column which had mixed numeric and text information.
When sorted, 94 came after 904, when it should have been 94 and then 904. I tried to fix this issued by
using render and for numerical values padded them out to 00094 and 00904. Now they sorted correctly.

I think a bit more details about the sort support in the documentation would be useful. Does 'type' and 'sort'
interact?

This question has accepted answers - jump to:

Answers

This discussion has been closed.