-
Notifications
You must be signed in to change notification settings - Fork 754
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
Default filters on load #321
Comments
Ahh, yes, I thought I had this on my to do list... wasn't there another issue addressing this? |
not that I could find, nor could I find an example setting default values for any filter really, I'm in the code now looking, specifically at uiDatepicker, so far I see mention of minDate and I assume maxDate someplace but I don't see the options to set those. val for from is being set in closeFrom, can't see where the To val() gets set yet. And closeFrom in bound to stickyHeadersInit, so it "should" be getting set but isn't, now this is just one of the filters I haven't looked at others yet but having a default filter sure woul deb nice so I'm going to keep searching. EDIT: Actually closeForm is bound to onClose in stickyHeadersInit, so it isn't run on load at all. |
okay adding at line 470
and at line 478
but this just sets the inputs, it doesn't start the filter event. EDIT: trying to work with adding
but no avail EDIT2: tried with, but the alert tells me this is still too soon??, not too soon the val is there :\ Why won't search trigger?
EDIT3: Add a bind to search, and it is searching, so maybe still to early? What is after tablesorter-initialized? |
Just for completeness, I also updated
to
|
attempted using $(window).load which is MUCH later then tablesorter-initialized, but still no sorting :\ if I click in the filter and just click off with out changing a thing it works, it triggers the search and uses the values. but this doesn't work
Oh wait I'm not setting the hidden input I bet that is the issue :\ |
Finally working, Let me know what you think of it Rob when you get a chance
|
Working on it... but I'm also trying to include all the other filters, as well as the filter formatter. |
yeah this is was just quick and dirty as a proof of concept, I like to make sure I have the right idea before i get too deep ;) Hope my work approve helps at least ;) |
I just pushed v2.10.8 which fixes the filter_formatter functions to now properly set the default values. I've also included a new option <th data-value="<30">Age</th> Also, these data attributes will over-ride the default values set in the filter_formatter. |
I'm not sure if there is a place for this and I just missed it, but I'd like to be able to have some default filter values on load.
like for a Datepicker, it's has a from and to field but they don't actually show up in the boxes nor does it's filter on load.
If there an example of something that has a default value and filters on load?
The text was updated successfully, but these errors were encountered: