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

199
Visualizações
Flask dynamic table when I select value from dropdown

I'm building my first app and got to point where I want to dynamically refresh my table when I chose some value from the drop down list. I'm using Flask with SQLAlchemy

I have query where all my users are listed:

customers = Customer.query.all()

and in my html page I created a dropdown list

{% for x in customers %}
<option>{{ x.name }}</option>
{% endfor %}

depending on the chosen value I want to automatically generate a table bellow from another query without using a submit button:

invoice = Invoice.query.filter_by(customer="chosen value").all()

and in the html:

<table >
 <thead>
  <tr>
   <th>Description</th>
   <th>Date</th>
   <th>number</th>
   <th>sum</th>
  </tr>
 </thead>

 <tbody>
  {% for i in invoice %}
  <tr>
   <td>{{ invoice.description }}</td>
   <td>{{ invoice.date }}</td>
   <td>{{ invoice.number }}</td>
   <td>{{ invoice.sum }}</td>
  </tr>
  {% endfor %}

 </tbody>

</table>

I know that for this option I need to use jquery and found some examples but couldn't figure out how to twist them for my solution.

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