Hi fellow Laracasters,
I've got a question I can't figure out myself, hopefully someone can help me out here.
What I've got
My ajax-request returns a dataset which I display on the page with v-for.
Using a text-input a user can filter the results. Nothing special so far.
The code looks like this:
<input type="search" class="form-control" v-model="search" >
<tr
v-for="match in matching
| filterBy search
| orderBy sortKey sortByDesc">
What I want
Next I want to add a date filter where only the records between two dates are shown. I have a column named planned_at where I want to filter on.
// The planned_at year should be at least this value
<input type="number" class="form-control" v-model="minYear">
// The planned_at year should be at the most this value
<input type="number" class="form-control" v-model="maxYear">
My filter actually looks a lot like the jQuery UI solution: http://jqueryui.com/slider/#range
-
Is it possible to make such a filter work in vuejs?
-
If yes, how should I do this and what would the code look like?
- Using a custom filter?
- Specifying a filterBy key?
- Any other suggestions?
I've tried various things, but since I'm not really a js-expert I've got no clue where to start.