Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

200
Visualizações
Filter Table Data Based on Multiple Comma Separated values

Currently, I am having a regex js function that filters the data based on the text entered in the input text, but I want to filter data based on values present in an array. Let say if the array contains 2 values, then it should filter the table for a particular column having either of those values.

function filter_data(Array, column_name, filter_text) {

      let data_provider = () => {

        const filterRegEx = new RegExp(filter_text, "i");

        let filter_value = {};

        filter_value[column_name] = filterRegEx;

        const filterCriterions = {
          op: "$or",

          criteria: [
            { op: "$regex", value: filter_value },
          ],
        };

        Array = new ArrayDataProvider(Array)

        return new ListDataProviderView(Array, { filterCriterion: filterCriterions });
      };

      return data_provider();
    }

The above function, I provide Array Data Provider, column name and filter text as a parameter. Now instead of filter text I want to provide array containing multiple values and filter the table based on those values. Please help me in this approach or specify any other approach that will work in this case.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda