Hi,
it is possible to create more than one virtual/math column? I'm trying to do that, only the last one appears.
$col = array();
$col["title"] = "col1v";
$col["name"] = "col1-virtual";
$col["width"] = "40";
$col["editable"] = false;
$col["hidden"] = false;
$col["on_data_display"] = array("do_mathmm","");
$cols[] = $col;
$col = array();
$col["title"] = "col2v";
$col["name"] = "col2-virtual";
$col["width"] = "40";
$col["editable"] = false;
$col["hidden"] = false;
$col["on_data_display"] = array("do_mathss","");
$cols[] = $col;
function do_mathss($data){
return $data["wholesale_price"] * $data["diff_order_ps"] * 2;
}
function do_mathmm($data){
return $data["wholesale_price"] * $data["diff_order_ps"] * 1;
}
Hello,
I tested your code and it works without any change.
Just make sure you have columns with name: $col["name"]
wholesale_price
diff_order_ps
to be used in on_data_display callback: return $data["wholesale_price"] * $data["diff_order_ps"] * 2;