1
I am using the plugin Jquery Chosen does not perform filter in php system.
Code to scan database and get data list:
<div class="grupo">
<!-- class="borda select2_single form-control comboauto" -->
<select name="id_projeto" id="id_projeto" class="borda select2_single form-control ">
<option value="">Selecione</option>
<?php
foreach (ProjetoModel::retorna(" order by descricao") as $obj) {
?>
<option value="<?php echo $obj->getid() ?>"
<?php echo $obj->getid()==$vObject->getidProjeto()?'selected':'' ?>>
<?php echo $obj->titulo; ?>
</option>
<?php } ?>
</select>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script src="chosen.jquery.js" type="text/javascript"></script>
<script src="docsupport/prism.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var config = {
'.chosen-select' : {},
'.chosen-select-deselect' : {allow_single_deselect:true},
'.chosen-select-no-single' : {disable_search_threshold:10},
'.chosen-select-no-results': {no_results_text:'Oops, nothing found!'},
'.chosen-select-width' : {width:"95%"}
}
for (var selector in config) {
$(selector).chosen(config[selector]);
}
</script>