Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!