Value of 0 is ignored when the data are cached in _fnFilterData
Value of 0 is ignored when the data are cached in _fnFilterData
![daJay](https://secure.gravatar.com/avatar/1b5b089a3981506653cdece217406a26/?default=https%3A%2F%2Fvanillicon.com%2F1b5b089a3981506653cdece217406a26_200.png&rating=g&size=120)
When attempting Custom filtering like in this example http://www.datatables.net/examples/plug-ins/range_filtering.html if the cellData is a value of 0 it is missing. In the DataTables function, _fnFilterData, the condition: if ( cellData ) returns false if cellData is 0, and cellData is not pushed into the filterData array, which it should for a value of 0.
This looks like a bug, or am I missing something?
This discussion has been closed.
Replies
It is not a bug. if() calculates if something is true or false. 0 is the numeric value of nothing. javascript along with every language that I am familiar with treats 0 as false. you need to figure out a different way of representing this value or use a different method to achieve your desired results.
Thanks for the response. I understand what you're saying, but don't agree - DataTables should deal with a number of 0 properly and not treat it as if it doesn't exist.
Anyhow, I was using version 1.10.1. It has already been fixed in 1.10.2 by removing the conditional statement altogether.