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

Missing state saved value is restored to select filter as null and inuse #493

Closed
konuch opened this issue Sep 5, 2018 · 3 comments
Closed
Labels

Comments

@konuch
Copy link
Contributor

konuch commented Sep 5, 2018

In our project, we have several tables which depend on each other.
For example, entries from TableA are used in a select filter in TableB.
We've just started using DT state saving. It works perfectly for the filters, but in case we have a saved filter value in TableB, then we remove this entry from TableA and move back to TableB, the filter tries to preselect this stored value in the dropdown, but it's selected as null and also set as inuse.

Expected behaviour: In case the option to be preselected does not exist in the select dropdown, do not try to preselect it.

@vedmack
Copy link
Owner

vedmack commented Sep 5, 2018

simple jsfiddle test page will speed up the fix for this issue

@konuch
Copy link
Contributor Author

konuch commented Sep 5, 2018

Hey, here's a jsfiddle, where you can simulate the behaviour:
http://jsfiddle.net/you54cr1/24/

Just uncomnent the line 13, which will simulate a non existing select option being stored in datatables state.

I also made a PR with a proposed solution. #494
Here's a fiddle whith the fix: http://jsfiddle.net/3q4d5sof/1/

@vedmack
Copy link
Owner

vedmack commented Sep 6, 2018

fixed by @konuch with PR 494

@vedmack vedmack closed this as completed Sep 6, 2018
@vedmack vedmack added the bug label Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants