Select dropdown with Abc input…

QuestionsSelect dropdown with Abc input…
Jan Valenta asked 11 months ago

how to enable keyboard input to select element… too many records to select by list… Thank you

 

 

1 Answers
Jan VALENTA answered 11 months ago

select2 = Solving the problem 🙂

//—PROBLEM HERE -lookup? !!!
$col = array();
$col[“title”] = “adresa”;
$col[“name”] = “adresa”;
$col[“dbname”] = “todos.adresa”; // this is required as we need to search in name field, not id
$col[“width”] = “100”;
$col[“align”] = “left”;
$col[“search”] = true;
$col[“editable”] = true;
$col[“formatter”] = “select”;

$col[“edittype”] = “select”; // render as select
# fetch data from database, with alias k for key, v for value
$str = $g->get_dropdown_values(“select distinct ID as k, Adresa as v from Vytahy”);
$col[“editoptions”] = array(“value”=>$str);
$col[“editoptions”][“dataInit”] = “function(){ setTimeout(function(){ link_select2(‘{$col[“name”]}’); },200); }”;

// to enable multiselect option-když chceš vybrat víc hodnot
//$col[“editoptions”][“multiple”] = true;

$col[“stype”] = “select”; // render as select
$col[“searchoptions”] = array(“value”=>$str,”sopt”=>array(“cn”));
$col[“searchoptions”][“dataInit”] = “function(){ setTimeout(function(){ link_select2(‘gs_{$col[“name”]}’); },200); }”;

$cols[] = $col;
//—STOP PROBLEM

Your Answer

7 + 18 =

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?