ssuperczynski / ngx-easy-table

The Easiest Angular Table. 12kb gzipped! Tree-shakeable. 55 features and growing!
https://ngx-easy-table.eu
MIT License
368 stars 100 forks source link

search error #396

Closed nbelghiti88 closed 1 year ago

nbelghiti88 commented 1 year ago

How can I search only on the visible elements on the table?

data : { name, description,  fall name , gameName}
columns: { name, description}

In this example the search will be on all attributes of data. I want to search only on visible columns.

ssuperczynski commented 1 year ago

In this case you need to pass to the table only visible rows:

    this.columns = [
      { key: 'phone', title: 'Phone' },
      { key: 'age', title: 'Age' },
      { key: 'company', title: 'Company' },
      { key: 'name', title: 'Name' },
    ];

    this.data = [...this.data].map((item) => ({
      phone: item.phone,
      age: item.age
        ... etc
    }))