Skip to content

How to filter dynamic data from database #72

@Stefjoe

Description

@Stefjoe

We try to get data from database, this part is working. But not the filter functionalities.
When we try the second case, we get the category name "trink" and we return false at this point. The call is also getting into the sort function, but nothing happen now.

filter method, console is showing FILTER and key "trink"


      filter: function(key) {
        console.log("::::::FILTER::::"+key);
        return this.$refs.cpt.filter(key);
      },

first case, it works

       filterOption: "show all",
        option: {
          itemSelector: ".element-item",
          getFilterData: {
            "show all": function() {
              return true;
            },
            "trink": function(el) {
              return false;
            }
          },
        },

**second case: it doesn't work, trink category dynamically is given **

       mounted() {
          Object.entries(self.categoryListe).forEach(([key, obj]) => {
            allCategories[obj.name] = function (el) { return false; };
          });

          self.option.getFilterData = allCategories;
       }

Thx for help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions