Value of 0 is ignored when the data are cached in _fnFilterData

Value of 0 is ignored when the data are cached in _fnFilterData

daJaydaJay Posts: 4Questions: 1Answers: 0

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?

Replies

  • rberlin01rberlin01 Posts: 3Questions: 1Answers: 0

    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.

  • daJaydaJay Posts: 4Questions: 1Answers: 0

    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.

This discussion has been closed.