on_render_csv exist?

Questionson_render_csv exist?
Adrian Sirbu asked 4 years ago


I want to use $e[“on_render_csv”] … something likeĀ $e[“on_render_excel”] = array(“custom_export”, null, true); but for exporting to CSV file and change some select value.

It’s possible?

function custom_export($param)
global $g;

// lookup of dropdown
$sql1 = “select id as k, tipoperatiune as v from cnpp_nomenclator_tip_operatiuni”;
$result1 = $g->execute_query($sql1);
if ($g->con)

$arr1 = $result1->GetRows();
foreach($arr1 as $rs1)
$rs1[“k”] = (!empty($rs1[“K”])) ? $rs1[“K”] : $rs1[“k”];
$rs1[“v”] = (!empty($rs1[“V”])) ? $rs1[“V”] : $rs1[“v”];
$lookup1[$rs1[“k”]] = $rs1[“v”];


$data = &$param[“data”]; // the complete grid object reference
foreach($data as &$d)
// skip first column title
if ($i++ == 0) continue;

$d[“idtipop”] = $lookup1[$d[“idtipop”]];

In excel working.


1 Answers
Abu Ghufran Staff answered 4 years ago


You can use custom export for csv as well. See demo code.


Refer Line 51,55,129

Abu Ghufran - Dev Team
Grid 4 PHP Framework
Your Answer

4 + 15 =

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?