I use phpgrid.com datagrid and display a table from database.
$dg = new C_DataGrid("SELECT CONCAT(issues.type,'0',issues.kbid) As kbid, issues.issuesummary, issues.productid, organizations.orgname, issues.priority, issues.createddate, issues.lastupdated, issues.status, issues.resolution, issues.assigneduserid FROM issues INNER JOIN organizations ON issues.creatingorg=organizations.orgid", "kbid", "IssueBase"); $dg -> enable_search(true); $dg -> set_col_edittype('status', 'select', 'OP:Open;CL:Closed;DF:Deferred;VE:Vendor;FQ:FAQ'); $dg -> set_col_edittype('priority', 'select', '0:None;1:Urgent;2:High;3:Medium;4:Low;5:Lowest'); $dg -> set_col_edittype('productid', 'select', $dd3); $dg -> set_col_edittype('resolution', 'select', 'PR:Pending Review;FX:Fixed;UR:Unreproducable;AD:As Designed;UF:Unable to Fix;WD:Withdrawn;NI:Need More Info;AS:Assigned;WK:Working on Issue;TS:Testing Issue;RJ:Rejected;UF:Temporary Fix;AC:Accepted'); $dg -> set_col_edittype('assigneduserid', 'select', $y); $dg -> set_col_edittype('orgname', 'select', $org); $dg->enable_export('EXCEL'); $dg->display();
But in export it still displays the database value still. How to do this?
Advertisement
Answer
Did you use “select” type set_col_edittype? If so, it should display the alias value in export.
$dg -> set_col_edittype("Dept", "select", "20:CSE;30:IT", false);
Reference: http://phpgrid.com/documentation/set_col_edittype/