Hello,
I want to use a colums as a dropdown. I looked for sample. The select is working:
select cetc.campaign_id as k, cec.title as v from categories_email_to_campaigns cetc left join categories_email_campaigns cec on cec.campaign_id = cetc.campaign_id ist working.
But how do I get it into the columndropdown, if not like:
————————
$col = array();
$col["title"] = "Kampagnenid";
$col["name"] = "campaign_id";
$col["dbname"] = "categories_email_to_campaigns.campaign_id"; // this is required as we need to search in name field, not id
$col["width"] = "21";
$col["align"] = "left";
$col["search"] = false;
$col["editable"] = true;
$col["edittype"] = "select"; // render as select
# fetch data from database, with alias k for key, v for value
$str = $g->get_dropdown_values("select cetc.campaign_id as k, cec.title as v from categories_email_to_campaigns cetc left join categories_email_campaigns cec on cec.campaign_id = cetc.campaign_id");
$col["editoptions"] = array("value"=>":;".$str);
$col["editoptions"]["dataInit"] = "function(){ setTimeout(function(){ $('select[name=campaign_id]').select2({width:'80%', dropdownCssClass: 'ui-widget ui-jqdialog'}); },200); }";
$cols[] = $col;
———
Did I miss anything to make the dropdown work?
Thanx and best regards, Mario