Autocomplete and formatte in the same column

QuestionsAutocomplete and formatte in the same column
Alexander Toth asked 2 years 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 2 years ago

Hi,

Please refer demos/integration/dropdown-select2.php

select2 renders dropdown along with autocomplete feature.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

14 + 8 =

Login with your Social Id:

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 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

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

Let us improve this post!

Tell us how we can improve this post?