1.10.4 Columns.data Bug
1.10.4 Columns.data Bug
Jamaur
Posts: 87Questions: 10Answers: 0
I recently upgraded from 1.10.2 to 1.10.4, and I noticed columns.data
is working differently.
$('#example').dataTable( {
"columnDefs": [ {
"targets": 0,
"data": function ( row, type, val, meta ) {
// row is an empty object
// val is undefined
// meta is undefined
}
} ]
} );
- The row parameter is an empty object.
- The val parameter is undefined.
- The meta paramater is undefined.
Could you kindly fix this issue.
Thanks in advance.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Does your actual
data
function consider theset
data type? There is a difference between 1.10.2 and 1.10.3 whereby theset
function is called upfront (that it wasn't before was a bug).If you aren't considering the
set
case, you should use thecolumns.render
option as it is readonly.Allan
Can you please elaborate on how to use the set case? As the example in columns.data is outdated. Thanks.
You could do something like:
If you don't need the ability to use a 'setter' - I would suggest not using
columns.data
as a function. It adds a lot of code for little benefit.Allan
Thanks this helps and yes I need the setter ability. But the meta parameter is still undefined (as I was using meta.col). Does the meta parameter become defined on a particular cirmustance?
Hi,
I found another issue and posted it on another thread. There is a test case to prove it.
http://datatables.net/forums/discussion/25846/columns-data-issue-setting-cell-values-more-than-once#latest