mardi 9 octobre 2018

Filter items from checkbox selection

I can search via a text input through my data items by title.

I am looking to also refine using checkboxes, these output the category names. How to now also filter the output items by the cat_array?

How can I filter by the chosen checkbox array ids?

    {
    "id": 1,
    "title": "Title one",
    "category_data": {
        "2": "Team",
        "7": "Queries"
    }
},

I had tested using this:

return  vm.info.filter(item => this.cat_array.includes(item.category_id))

Codepen example: https://codepen.io/anon/pen/XxNORW?editors=1011

Thanks




Aucun commentaire:

Enregistrer un commentaire