dropdown onload

Questionsdropdown onload
german asked 2 weeks ago

hi sir,

dependent drop down onnload after update the onload doesnt work properly in edit.

$col = array();
$col[“title”] = “Bank Name”; // caption of column
$col[“name”] = “bankid”;
$col[“dbname”] = “ADMIN.proc_banktovendor.bankid”; // this is required as we need to search in name field, not id
$col[“width”] = “40”; // grid column name, must be exactly same as returned column-name from sql (tablefield or field-alias)
$col[“editable”] = true;
$col[“search”] = true;
$col[“edittype”] = “select”; // render as select
$col[“isnum”] = true;
$col[“isnull”] = true;
$statuss='”status”‘;
# fetch data from database, with alias k for key, v for value
$strd = $g->get_dropdown_values(“select $bankid as k,$bankname as v from ADMIN.$bankt where $statuss=’AA’ “);
$col[“editoptions”] = array( “value”=>”:;”.$strd,
“onchange” => array(“sql”=>”select distinct $branchid as k, $branchname as v from ADMIN.$branch
inner join ADMIN.$bankt on ADMIN.$bankt.$bankid=ADMIN.$branch.$bankid
WHERE ADMIN.$branch.$bankid=(select $bankid from ADMIN.$bankt where ADMIN.$bankt.$bankid='{bankid}’ and $statuss=’AA’ )”,
“callback” => “update_bank”
)
,”style”=>”width:150px”
);
$col[“editoptions”][“dataInit”] = “function(){ setTimeout(function(){ link_sts(‘{$col[“name”]}’); },200); }”;
$col[“stype”] = “select”;
$col[“searchoptions”] = array(“value” => “:;”.$strd);
$col[“searchoptions”][“dataInit”] = “function(){ setTimeout(function(){ link_sts(‘gs_{$col[“name”]}’); },350); }”;

$col[“formatter”] = “select”;
$col[“formoptions”] = array(“rowpos”=>”8”, “colpos”=>”1”) ;
$cols[] = $col;

$col = array();
$col[“title”] = “Branch Name”; // caption of column
$col[“name”] = “branchid”;
$col[“dbname”] = “ADMIN.proc_banktovendor.branchid”; // this is required as we need to search in name field, not id
$col[“width”] = “40”; // grid column name, must be exactly same as returned column-name from sql (tablefield or field-alias)
$col[“editable”] = true;
$col[“search”] = true;
$col[“edittype”] = “select”; // render as select
$col[“isnum”] = true;
$col[“isnull”] = true;
$statuss='”status”‘;
# fetch data from database, with alias k for key, v for value
$strd = $g->get_dropdown_values(“select $branchid as k,$branchname as v from ADMIN.$branch “);
$col[“editoptions”] = array( “value”=>”:;”.$strd,
“onchange” => array(“sql”=>”select * from ADMIN.$branch WHERE ADMIN.$branch.$branchid='{branchid}’
and ADMIN.$branch.$bankid=(select $bankid from ADMIN.$bankt where ADMIN.$bankt.$bankid='{bankid}’) “,
“callback” => “update_branchid”)
,”style”=>”width:150px”
);
$col[“editoptions”][“dataInit”] = “function(){ setTimeout(function(){ link_sts(‘{$col[“name”]}’); },200); }”;
//$col[“editoptions”][“onload”][“sql”] = “select $branchid as k,$branchname as v from ADMIN.$branch where ADMIN.$branch.$bankid='{bankid}’ and $statuss=’AA'”;

$col[“stype”] = “select”;
$col[“searchoptions”] = array(“value” => “:;”.$strd);
$col[“searchoptions”][“dataInit”] = “function(){ setTimeout(function(){ link_sts(‘gs_{$col[“name”]}’); },350); }”;
$col[“formatter”] = “select”;
$col[“formoptions”] = array(“rowpos”=>”8”, “colpos”=>”2”) ;
$cols[] = $col;

$col = array();
$col[“title”] = “Bank Id “; // caption of column
$col[“name”] = “bankname”; // grid column name, must be exactly same as returned column-name from sql (tablefield or field-alias)
$col[“dbname”] = “ADMIN.proc_banktovendor.bankname”; // this is required as we need to search in name field, not id
$col[“width”] = “120”;
$col[“align”] = “left”;
$col[“search”] = true;
$col[“editable”] = true;
$col[“isnum”] = true;
$col[“isnull”] = true;
$col[“show”] = array(“list”=>false,”edit”=>true,”add”=>true);
$col[“formoptions”] = array(“rowpos”=>”9”, “colpos”=>”1”);
$cols[] = $col;

Your Answer

20 + 14 =

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?