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

Filters no longer filtering #13

Open
mavrik-kl opened this issue Apr 12, 2019 · 6 comments
Open

Filters no longer filtering #13

mavrik-kl opened this issue Apr 12, 2019 · 6 comments

Comments

@mavrik-kl
Copy link

Hello. I am having trouble with filters being applied/removed in examples/datatable.py when I enter 'f', and 'F', respectively. My local workaround was to simplify the filter and call self.invalidate() as shown in the the attached diff. With the patch in place, entering 'f', works as expected (i.e., I am left with records 0-4 displayed). Note, however, that using the down arrow (or mouse wheel) to scroll past the last record results in an exception. Upon entering 'F', records 0-9 are displayed, and subsequent scrolling reveals additional records as expected. I see that both apply_filters() and clear_filters() in pandwid/datatable/datatable.py include a self.invalidate() statement, but in both cases that statement has been commented out. What's the current/proper way to have filter changes take effect and be rendered on the screen? Thanks.
datatable.py.diff.txt

@tonycpsu
Copy link
Owner

Just to set expectations here: the master branch of panwid is very raw at this point, so you'll run into things like this. I'm pushing a lot of other changes into it and not paying much attention to regressions in other areas. Since the project I'm most focused on isn't currently using the filter functionality, it's broken, as you've discovered here.

With that said -- I'm actually not sure that filtering and pagination ever worked together properly. If it did, it was by accident, and recent changes in how rows are updated when the underlying data changes rather than reloading the entire table will make a solution difficult. I have a lot of other things on my plate right now, so it might be a while before I get to fixing this.

@mavrik-kl
Copy link
Author

No worries ... Thanks for letting me know where you are at with respect to expectations. In the meantime, I'd like to keep moving forward on my project. Would you say that calling self.invalidate() is the best workaround until a preferred solution can be implemented, or is it going to cause other/new problems? Is the preferred solution easy to express in a paragraph or two? Perhaps, I can try to implement it locally and submit patch for consideration?

@tonycpsu
Copy link
Owner

Try to upgrade to latest master and see if that works for you. It still won't work with pagination, and nothing else will until I get time to implement a more comprehensive solution for row filtering.

@tonycpsu
Copy link
Owner

Er, pushed too soon. Try again with c972b45

@mavrik-kl
Copy link
Author

Pulled and tested. Thanks!

@tonycpsu tonycpsu reopened this Apr 15, 2019
@tonycpsu
Copy link
Owner

Sorry, but I had to revert this change for now because it was breaking some other datatable functionality that I'm using right now. I've reopened this ticket as a reminder to fix this properly in a way that doesn't break other things.

@tonycpsu tonycpsu reopened this Apr 15, 2019
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

2 participants