[Vuejs]-Searching v-data-table to filter results when <td>'s are arrays of data too

0๐Ÿ‘

 handleFilterCustomerTable(searchInput) {
    this.filteredCustomerTable = this.originalCustomerTable.filter(cust => {
        let rowText = '';
        cust.forEach(c => {
            rowText += this.createSearchText(
              c.pos,
              c.centerNumber,
              this.formatSSN(c.ssn),
              c.firstName,
              c.lastName,
              c.dob,
              c.phone,
              c.email,
              c.custId
            );
          });
          return rowText.toLocaleLowerCase().indexOf(searchInput.toLocaleLowerCase()) >= 0;
        });
     },
      createSearchText(...inputs) {
         return inputs.join('\0'); // '\0' is the literal null character
     },

Leave a comment