Skip to content
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

How to filter dynamic data from database #72

Open
Stefjoe opened this issue Sep 21, 2019 · 0 comments
Open

How to filter dynamic data from database #72

Stefjoe opened this issue Sep 21, 2019 · 0 comments

Comments

@Stefjoe
Copy link

Stefjoe commented Sep 21, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant