Hi Abu
Is there a way to link $col[\”title\”] to a MySQL field/table?
thanks
Tony
If you omit setting $col[“title”] in column definition, it will pick database field name automatically after remove _ and making it first letter upper case words. For that i can send you an update. Will it work for your case?
thanks Abu
I need to link the column title to another separate table and field. A field different than the actual field that represents the column.
thanks
Tony
Can you explain with some example? whats the business case linked with it.
I need to allow the user to be able to customize the text of the column title by filling in a field in another table.
thanks
Tony
You can assign custom tooltip to any column using:
$col[“tooltip”] = “My Custom Tooltip from other table”;
Now before that, you need to fetch the text to show there from database. For that you can execute query like:
$rs = $g->get_one(“select tooltip, …… where col_name like ‘{$col[“name”]}'”);
And use:
$col[“tooltip”] = $rs[“tooltip”];
Hope it helps.
Thanks Abu
I did the following and it worked.
$phase1 = $g->execute_query(“select phase1 as ” from tblprojectdetails where projectnumber = ‘$groupselectednew'”);
$col[“title”] = “$phase1(%)”;
//$col[“title”] = “IFR (%)”;
$col[“name”] = “phase1”;
$col[“width”] = “75”;
$col[“editable”] = true;
$col[“search”] = true;
$col[“export”] = true;
$col[“align”] = “center”;
$col[“formatter”] = “percentage”;
$col[“editoptions”] = array(“size”=>20, “defaultValue”=>’100.00′);
$cols[] = $col;
thanks
Tony