Autocomplete Field Search entiry string,

  • hyperx
  • Autore della discussione
  • Offline
  • Nuovo Utente
  • Nuovo Utente
Di più
9 Anni 9 Mesi fa #2185 da hyperx
Autocomplete Field Search entiry string, è stato creato da hyperx
Hello,

currently the Autocompletion Field works only as an autocompletion on the first letter so if you start with a S, all Tags starting with a S are shown.

So lets say i have a tag "See Example" it will show up when i start to type "see", however i would also like for it to show up when i start to type "example"

Is it possible to change this in th JS File and if so where?

To adjust the minLength, so the autocomplete funtion doesn't start after the first letter is probably easily changed by changing the number on Line 26 or not?

Si prega Accesso o Crea un account a partecipare alla conversazione.

Di più
9 Anni 9 Mesi fa #2186 da andrea_4g
Risposta da andrea_4g al topic Autocomplete Field Search entiry string,
== minLength ==
You can change the minLength value by editing:
modules/mod_cpsearch/helper.php
and change lines 428-430 from
Code:
jQuery(document).ready(function (){ jQuery( "#ac_'.$fId.'" ).autocomplete({ source: function(request, response) { ...
to:
Code:
jQuery(document).ready(function (){ jQuery( "#ac_'.$fId.'" ).autocomplete({ minLength: 2, source: function(request, response) { ...

You can also do that without altering the module non-overridable code by adding the following js script to your page:
Code:
jQuery(document).ready(function (){ jQuery( "#ac_cp_field_96_1" ).autocomplete("option", "minLength", 2); });
where ac_cp_field_96_1 is the id of your autocomplete field and 2 is the number of chars to be typed.

== search in the middle ==
You have to alter Custom Properties core code (and that will leave you with a custom version of CP that will be overwritten upon future upgrades, and so on and so forth ...)

Edit file components/com_customproperties/controller.php
Change line 224 from:
Code:
"AND v.label LIKE '$value%' " .
to
Code:
"AND v.label LIKE '%$value%' " .
I seguenti utenti hanno detto grazie : hyperx

Si prega Accesso o Crea un account a partecipare alla conversazione.

Tempo creazione pagina: 0.150 secondi