select2 dropdown depent issue

Questionsselect2 dropdown depent issue
[email protected] asked 4 months ago

Abhu Im having trouble with dropdown dependent using select2, When im adding a record works fine for example
if column1 is = to id 1 then column 2 shows records according to value on column1 but if i go edit mode column2 shows all records in table, besides in edit mode if i change value on column1 value on column2 is not resseting until i click on column2

code sample

$col=array();
$col[“formatter”]=”select”;
$col[“title”]=”Family”;
$col[“hidden”]=false;
$col[“name”]=”idFamilia”;
$col[“width”]=”5″;
$col[“editable”]=true;
$col[“align”]=”center”;
$col[“search”]=true;
$client_lookup=$g->get_dropdown_values(“select distinct id as k, numeroFamilia as v from calibra2.calibracion_familias ORDER by numeroFamilia”);
$col[“stype”]=”select”;
$str=”:;”.$client_lookup;
$col[“searchoptions”]=array(“value”=>$str,”separator”=>”:”,”delimiter”=>”;”);
$col[“edittype”]=”select”;
$col[“editoptions”]=array(“value”=>$client_lookup);
$col[“editoptions”]=array(
“value”=>$str,
“onchange”=>array(    “sql”=>”select distinct id as k, nombreSubfamilia as v from calibra2.calibracion_subfamilias WHERE idFamilia = ‘{idFamilia}'”,
“update_field”=>”idSubfamilia”)
);
$col[“searchoptions”][“dataInit”]=”function(){ setTimeout(function(){ $(‘select[name=idFamilia]’).select2({width:’80%’, dropdownCssClass: ‘ui-widget ui-jqdialog’}); },200); }”;
$col[“editoptions”][“dataInit”]=”function(){ setTimeout(function(){ $(‘select[name=idFamilia]’).select2({width:’80%’, dropdownCssClass: ‘ui-widget ui-jqdialog’}); },200); }”;
$col[“dbname”]=”ins.idFamilia”;
$cols[]=$col;
$col=array();
$col[“formatter”]=”select”;
$col[“title”]=”Subfamily”;
$col[“hidden”]=false;
$col[“name”]=”idSubfamilia”;
$col[“width”]=”8″;
$col[“editable”]=true;
$col[“align”]=”center”;
$col[“search”]=true;
$client_lookup=$g->get_dropdown_values(“select distinct id as k, nombreSubfamilia as v from calibra2.calibracion_subfamilias ORDER by nombreSubfamilia”);
$col[“stype”]=”select”;
$str=”:;”.$client_lookup;
$col[“searchoptions”]=array(“value”=>$str,”separator”=>”:”,”delimiter”=>”;”);
$col[“edittype”]=”select”;
$col[“editoptions”]=array(“value”=>$client_lookup);
$col[“searchoptions”][“dataInit”]=”function(){ setTimeout(function(){ $(‘select[name=idSubfamilia]’).select2({width:’80%’, dropdownCssClass: ‘ui-widget ui-jqdialog’}); },200); }”;
$col[“editoptions”][“dataInit”]=”function(){ setTimeout(function(){ $(‘select[name=idSubfamilia]’).select2({width:’80%’, dropdownCssClass: ‘ui-widget ui-jqdialog’}); },200); }”;
$col[“dbname”]=”ins.idSubfamilia”;
$cols[]=$col;

2 Answers
[email protected] answered 4 months ago

EDIT:
Even on edit or insert mode column 2 shows all records, to see filtered records based on column 1 i have to click column 2 I need that everytime i change value on record1 column2 resets and show records according to value in record1 no matter if im on edit or insert mode

Abu Ghufran Staff answered 3 months ago

Hello,

If this issue still exist, please share screen-cast showing this issue.
You can use screencastify.com

PS: Apologies for the delay. Due to limited work schedule, we are focused in giving technical support to active licensed customers only. If you already have license, please let us know your payment email OR order number so we can update our records.

 

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

4 + 6 =

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?