Field display from database function

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
Giblet535
User
Posts: 5

Field display from database function

Post by Giblet535 »

I have an integer table field, Member_Of, that references a Groups table:
Groups:
_id int(11),
Group_Name varchar(255),
Member_Of int(11)

0 = '/', so rows:
'6557','Phosphates','0' would display as "/Phosphates"
'87888','Manganese','6557' would display as "/Phosphates/Manganese"
etc.

This structure is all that is needed to represent a hierarchical structure, but a defined database function is required to display the value.

Use of the function is as simple as 'SELECT Explode({Member_Of}) AS Group_Name ORDER BY Group_Name'

How can I replace a field with the results of that SELECT within PHPMaker?


danielc
User
Posts: 1601

Post by danielc »

Use Row_Rendered server event to change your display value:
$this-><yourfield>->ViewValue = yourfunction($this-><yourfield>->CurrentValue);

See Server event and Client script.


Giblet535
User
Posts: 5

Post by Giblet535 »

I'll give that a try and post the result, thanks.


Post Reply