Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range filters don't work with function properties #627

Open
cpdog opened this issue Jun 25, 2020 · 1 comment
Open

Range filters don't work with function properties #627

cpdog opened this issue Jun 25, 2020 · 1 comment

Comments

@cpdog
Copy link

cpdog commented Jun 25, 2020

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.

cpdog added a commit to cpdog/yadcf that referenced this issue Jun 25, 2020
@cpdog
Copy link
Author

cpdog commented Oct 19, 2020

@vedmack let me know if you need any more info about this bug or if I messed up the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant