_fnVisibleToCOlumnIndex Truthiness bug.

_fnVisibleToCOlumnIndex Truthiness bug.

deviansdevians Posts: 4Questions: 0Answers: 0
edited January 2013 in Bug reports
calling _fnVisibleToColumnIndex("10") does not produce a position from iPos, because $.inArray() has a truthiness issue where "10" != 10. Suggest throwing in a parseInt if you're expecting an integer? ie $.inArray(parseInt(iMatch), aiVis);

Replies

  • allanallan Posts: 61,740Questions: 1Answers: 10,111 Site admin
    _fnVisibleToColumnIndex (a "private" function) expects an integer, so there is no validation of the data passed in. If you pass in a string, you'll get an unexpected result - as is the case here. If you want to pass in a string, the parseInt should be done by the caller :-)

    Allan
This discussion has been closed.