Jquery Chosen plugin does not filter search on PHP site

Asked

Viewed 130 times

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>

jquery Chosen plugin inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

 <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>

1 answer

0


The error is in breaking the line within the select option tag

<option value="<?php echo $obj->getid() ?>" 
    <?php echo $obj->getid()==$vObject->getidProjeto()?'selected':'' echo $obj->titulo; ?>
 </option>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.