Menu

#28 Rico 3 LiveGrid with Forms Sort on calculated field

v2.x
open
nobody
None
5
2016-09-07
2016-09-07
dephillips
No

$oForm->AddEntryFieldW("ID", "ID", "H", "<auto>",50);
$oForm->AddCalculatedField("concat (t.LastName,', ',t.FirstName)","Name");
$oForm->CurrentField['width'] = 250;
$oForm->SortAsc();</auto>

Causes an sql error due to t.Calc_1 field not existing. This is caused by the field 'Formula' option not being set in ricoLivegridForms.php function AddCalculatedField. The following line:

$this->CurrentField["Formula"]=$ColumnFormula;

should be added after the line:

$this->CurrentField["ColName"]="Calc_".$this->FieldCnt;

In addition the line to add the column should be changed to:

$this->oParseMain->AddColumn($ColumnFormula, "Calc_".$this->FieldCnt);

Discussion


Log in to post a comment.

MongoDB Logo MongoDB