yadcf
yadcf copied to clipboard
Range filters don't work with function properties
See: http://live.datatables.net/ziqipodu/1
Note that the property "doubleAge" is defined as a function. DataTables will execute the function to retrieve the property value. For the "select" filter type, yadcf works properly and filters the data properly. For the range filters however, yadcf doesn't filter at all.
This appears to be because the dot2obj
function has the following code
dot_refs = dot_refs.split(".");
for (i = 0; i < dot_refs.length; i++) {
if (tmpObj[dot_refs[i]] !== undefined && tmpObj[dot_refs[i]] !== null) {
tmpObj = tmpObj[dot_refs[i]];
} else {
return '';
}
}
This doesn't consider that a property may be a function. Consequently, the filter is comparing against the function definition rather than the result of the function invocation.
@vedmack let me know if you need any more info about this bug or if I messed up the PR.