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 #66
Comments
Hey @fr0z3nfyr, sorry I've been busy. I'll take a look either in the next an hour or so, if not, then tomorrow. |
Can you paste your component config and the js settings you're initializing jquery datatables with? For range filter, you'll need to use a custom search method on that column. It looks like sSearch0 would be in a format like "fromvalue-tovalue" so the custom find would need to explode on that separator to get the two values. Custom find works like this:
In your model add a function like:
But yadcf states that it supports only |
Hey sorry, I was sick with a fever, just checked your comment. I will post my component settings as soon as I get back on the project. Meanwhile you can check my interaction with author of yadcf @ http://stackoverflow.com/questions/31045543/ I too was a little confused originally but somehow (probably by fluke) got it working this far. I will also post an implementation for Daniel(yadcf author) on his thread(see comments on answer on SO link). |
I would like to implement range filters similar to what is used here http://www.alpha.mobotrix.com/cake/users but not necessarily using YADCF. |
@destinydriven the backend is setup for this but you need to manually add the column filters and call the filter function with jquery plugin. See https://legacy.datatables.net/examples/api/multi_filter.html The important bit is calling
where otable is a reference to the datatables object for your specific table. |
@tigrang So I need to override render() in the Helper so I can inject the footer into the table? |
@destinydriven check this gist out for an exmaple. https://gist.github.com/tigrang/e6b9d53a407280f791f3abceea285394 |
@tigrang Awesome thanks, that worked great for me. Perhaps we can add this to the wiki. I'm sure it's a much requested feature. |
@destinydriven is containable actually making a join or is it doing a separate query? Can you check sql log? |
@tigrang It's doing a left join. |
@destinydriven can you hop on irc? |
How can I get range filters to work? I have two inputs for a column to do a range search, see image for sample. when I check in console, i get
sSearch_0
,sSearch_1
,sSearch_2
,sSearch_3
in config.One, why is
sSearch3
required if there is no search on the last column. I think I have to check DT also to see if that is a mandate.Two, I'm using YADCF for column filtering, so for the range filter, the searched range returns 0 rows. Probably, the query to DB is being passed incorrectly. How can I fix this? I'm supposing that the range filters for dates will also misbehave, I haven't tested.
The text was updated successfully, but these errors were encountered: