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

249
Views
Filtrar una tabla por una cláusula <select> con Django

Tengo una tabla que debe filtrarse en una cláusula HTML seleccionada que brinda una funcionalidad como un filtro de Excel. ¿Cómo se puede implementar este filtrado? Quiero filtrarlo por dueño

Ejemplo de tabla:

 <table class="table table-hover"> <thead class="table-bordered"> <tr> <th scope="col">NumberID</th> <th scope="col">Title</th> <th scope="col"> Owner <select name="columns" class="form-select" aria-label="Default select example"> <option selected>All</option> <option value='option1' id="filterOwner">1</option> <option value='option2' id="filterOwner">2</option> <option value='option3' id="filterOwner">3</option> <option value='option4' id="filterOwner">4</option> <option value='option5' id="filterOwner">5</option> </select> </th> <th scope="col">Status</th> </tr> </thead> <tbody id='myTable'> {% for data in dataset %} <tr> <td>{{ data.NumberID }}</a></td> <td>{{ data.title }}</a></td> <td>{{ data.owner }}</a></td> <td>{{ data.currentMonthStatus }}</a></td> <td> <a type="button" class="btn btn-outline-success btn-sm" href="/updatecontrol/{{data.NumberID}}">edit utility control</a> </td> </tr> {% endfor %} </tbody>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Debe utilizar formularios para las operaciones de filtrado.

Formulario de ejemplo:

 class MyForm(forms.Form): CHOICES = (('Option 1', 'Option 1'),('Option 2', 'Option 2'),) field = forms.ChoiceField(choices=CHOICES)

Si desea realizar la operación sin POST o actualizar la página, debe usar AJAX.

Puede asignar las opciones que desee como OPCIONES e imprimirlas en la página html.

about 4 years ago · Juan Pablo Isaza Report
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!