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

192
Visualizações
Yajra datatable modified search in each column

I added a search in each column of the table using the initComplete method. But I need to change something, and I don't know how.

  1. How to add search cells to the table header (under the column names);

  2. How to make search cells only on the second and third columns, and not on all.

    public function html()
         {
             return $this->builder()
                 ->setTableId('format-table')
                 ->columns($this->getColumns())
                 ->minifiedAjax()
                 ->select()
                 ->initComplete("function () {
                                         this.api().columns().every(function () {
                                             var column = this;
                                             var input = document.createElement(\"input\");
                                             $(input).appendTo($(column.footer()).empty())
                                             .on('change', function () {
                                                     column.search($(this).val(), false, false, true).draw();
                                                 });
                                         });
                                }")
                 ->serverSide()
                 ->dom('B<"top"i>rt<"bottom"flp><"clear">')
                 ->orderBy(1, 'asc')
                 ->buttons(
                     Button::make('create')->editor('editor'),
                     Button::make('edit')->editor('editor'),
                     Button::make('remove')->editor('editor'),
                     Button::make('export'),
                     Button::make('print'),
                     Button::make('reset'),
                     Button::make('reload')
                 )
                 ->editor(
                     Editor::make()
                         ->fields([
                             Fields\Text::make('name')
                         ])
                 );
         }
    

If you need to add some more data, just tell me.

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