Autocomplete and formatte in the same column

QuestionsAutocomplete and formatte in the same column
Alexander Toth asked 9 months ago

Question: is possible to use in the same column

$col[“formatter”] = “autocomplete”;
and
$col[“formatter”] = “select”;

I’ve tried but it doesn’t work:

$col = array();
$col[“title”] = “Responsabile”;
$col[“name”] = “responsabile”;
$col[“editable”] = true;
$col[“editrules”] = array(“number”=>true);
$col[“isnull”] = true;
$col[“formatter”] = “autocomplete”;
$col[“formatoptions”] = array(“sql”=>”SELECT dipendenti.ID_Dipendente, dipendenti.Cognome as v FROM dipendenti”,”search_on”=>”Cognome”,”callback”=>”fill_form”);
$str = $g->get_dropdown_values(“SELECT ID_Dipendente as k, Cognome as v FROM dipendenti”);
$col[“editoptions”] = array(“value”=>$str);
$col[“formatter”] = “select”;
$cols[] = $col;

<script>
function fill_form(data)
{
setTimeout(function(){
jQuery(“input[name=responsabile].FormElement”).val(data.ID_Dipendente);
jQuery(“input[name=responsabile].editable”).val(data.ID_Dipendente);
},200)}
</script>

1 Answers
Abu Ghufran Staff answered 9 months ago

Hi,

Please refer demos/integration/dropdown-select2.php

select2 renders dropdown along with autocomplete feature.

_________________________
Abu Ghufran - Dev Team
PHP Grid Framework
 
Your Answer

9 + 6 =

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!