Episode 05 • One Page App With Drupal 8 and Vue.js

Making Filter Dynamic

In this episode of Drupal 8 and Vue.js learn how to make our genre filter dynamic. And for that we are going to use jQuery.

Our genre filter from the last episode is ok, but it's not great. First of all it's hard coded, so that is not good, we don't want to add new values to it every time we add a movie with a new genre.

And secondly there are some genres in it that we don't even have in our movie list. So if we choose that, we get an empty list. So that is also not the coolest.

We are going to fix all those problems using jQuery. First we are going iterate through our movies, to get available genres. And then we are going to make an array with unique genre values that we can display in our option list.

At the end we will have completely dynamic filter with all the available genres and it will populate dynamically as we add new movies and new genres.

Download code
  • Episode 01 • Duration 21:08

    Intro To Vue.js

  • Episode 02 • Duration 32:00

    Getting The Data From Drupal 8

  • Episode 03 • Duration 04:44

    Enable CORS for Drupal 8

  • Episode 04 • Duration 19:55

    Live Filtering With Vue.js

  • Episode 05 • Duration 15:52

    Making Filter Dynamic

  • Episode 06 • Duration 24:47

    Displaying Single Data Item

  • Episode 07 • Duration 09:42

    Vue Components

  • Episode 08 • Duration 14:26

    Vue Routing

  • Episode 09 • Duration 21:10

    Routing and Components

  • Episode 10 • Duration 31:35

    Creating Movie With Vue.js

  • Episode 11 • Duration 14:35

    Delete Movie With Vue.js

  • Episode 12 • Duration 23:01

    Update Movie With Vue.js

  • Episode 13 • Duration 25:16

    Register a User on Drupal 8

  • Episode 14 • Duration 13:35

    Vue Transitions

  • Episode 01 • Duration 21:08

    Intro To Vue.js

  • Episode 02 • Duration 32:00

    Getting The Data From Drupal 8

  • Episode 03 • Duration 04:44

    Enable CORS for Drupal 8

  • Episode 04 • Duration 19:55

    Live Filtering With Vue.js

  • Episode 05 • Duration 15:52

    Making Filter Dynamic

  • Episode 06 • Duration 24:47

    Displaying Single Data Item

  • Episode 07 • Duration 09:42

    Vue Components

  • Episode 08 • Duration 14:26

    Vue Routing

  • Episode 09 • Duration 21:10

    Routing and Components

  • Episode 10 • Duration 31:35

    Creating Movie With Vue.js

  • Episode 11 • Duration 14:35

    Delete Movie With Vue.js

  • Episode 12 • Duration 23:01

    Update Movie With Vue.js

  • Episode 13 • Duration 25:16

    Register a User on Drupal 8

  • Episode 14 • Duration 13:35

    Vue Transitions