0
I have a SELECT like this:
<select id="filtro-uf" name="filtro-uf" class="form-control">
<option value=" ">Selecione</option>
<option value='AC'>Acre (AC)</option>
<option value='AL'>Alagoas (AL)</option>
<option value='AP'>Amapá (AP)</option>
<option value='AM'>Amazonas (AM)</option>
<option value='BA'>Bahia (BA)</option>
<option value='CE'>Ceará (CE)</option>
<option value='DF'>Distrito Federal (DF)</option>
<option value='ES'>Espírito Santo (ES)</option>
<option value='GO'>Goiás (GO)</option>
<option value='MA'>Maranhão (MA)</option>
<option value='MT'>Mato Grosso (MT)</option>
<option value='MS'>Mato Grosso do Sul (MS)</option>
<option value='MG'>Minas Gerais (MG)</option>
<option value='PA'>Pará (PA)</option>
<option value='PB'>Paraíba (PB)</option>
<option value='PR'>Paraná (PR)</option>
<option value='PE'>Pernambuco (PE)</option>
<option value='PI'>Piauí (PI)</option>
<option value='RJ'>Rio de Janeiro (RJ)</option>
<option value='RN'>Rio Grande do Norte (RN)</option>
<option value='RS'>Rio Grande do Sul (RS)</option>
<option value='RO'>Rondônia (RO)</option>
<option value='RR'>Roraima (RR)</option>
<option value='SC'>Santa Catarina (SC)</option>
<option value='SP'>São Paulo (SP)</option>
<option value='SE'>Sergipe (SE)</option>
<option value='TO'>Tocantins (TO)</option>
</select>
And my chart looks like this, in short:
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<td>Razão social</td>
<td>Responsável</td>
<td>Cidade/UF</td>
</tr>
</thead>
<tbody>
<tr data-uf="SP">
<td>Razão social 01</td>
<td>Nome do responsável 01</td>
<td>São Paulo/SP</td>
</tr>
<tr data-uf="RJ">
<td>Razão social 02</td>
<td>Nome do responsável 02</td>
<td>Niterói/RJ</td>
</tr>
<tr data-uf="RS">
<td>Razão social 03</td>
<td>Nome do responsável 03</td>
<td>Porto Alegre/RS</td>
</tr>
<tr data-uf="RS">
<td>Razão social 04</td>
<td>Nome do responsável 04</td>
<td>Petolas/RS</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
I would like to hide the rows of the table with the date-Uf="UF" equal to the UF of the SELECT VALUE, when selecting the Status, and when selecting the first option that is value " ", with label "Select", Jquery would undo the hidden lines. I can do it with a request for $.load() and $.ajax() but it’s taking a long time, and I thought that way it would be agile and only manipulate the DOM without the back-end request. Thank you!
Your code does not re-display the hidden lines and did not resolve the issue
– ElvisP
Oops. I edited the answer. Check if it works ;)
– Atila Silva