Giter VIP home page Giter VIP logo

Comments (2)

xiaocheng555 avatar xiaocheng555 commented on July 23, 2024 1

No description provided.

image

I add a filter demo and you can see how the demo is written.

url:https://xiaocheng555.github.io/el-table-virtual-scroll/#/SortDemo?code=SortDemo&codeTitle=%E6%8E%92%E5%BA%8F%26%E8%BF%87%E6%BB%A4

from el-table-virtual-scroll.

willtham1 avatar willtham1 commented on July 23, 2024

Wow you implemented that quick nice! I got the feature to work easily.
Added @filter-change="onFilterChange" to my el-table;

  methods: {
    onFilterChange(val) {
      if (val.statuss.length) {
        this.tableData = this.originalData.filter(item => {
          return val.statuss.some(status => item.status === status)
        })
      } else {
        this.tableData = this.originalData
      }
    },
},
  created() {
    this.originalData = [...this.tableData]
  },

This was used with the implementation of a vuex module containing my array.
I created a copy of the array within the created() then passed val into the function which contains the filter option to the function(This is obtained by my column-key='statuss'). In addition for my way of re-populating the original data I used an else to reset the table.
This is for anyone who needs another example to use besides xiao's!!!

from el-table-virtual-scroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.