21287 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 210 Views |
-
ComplexTableField SQL Join to get data

28 October 2011 at 4:08am
Hi everyone
I want to get some data from a related table to show in the result set of ComplexTableField
$tablefield = new ComplexTableField(
$this,
'Results',
'Result',
array(
'PositionFinished' => 'Position Finished',
'PointedScored' => 'Pointed Scored',
'CarNumber' => 'Car Number'
),
'getCMSFields_forPopup'
);
$fields->addFieldToTab("Root.Content.Result Manager",$tablefield);CarNumber exists in the table "Teams", the other fields exists in "Results". However its not displaying the correct data.
The below is the set up with results class...
static $has_one = array (
'Event' => 'Event',
'Team' => 'Team',
'Season' => 'Season'
);and the event has many results. Any ideas why this wouldnt appear?
Cheers
-
Re: ComplexTableField SQL Join to get data

28 October 2011 at 7:48am
You can use dot notation inyour objects summaryfields. So I think this might work:
$tablefield = new ComplexTableField(
$this,
'Results',
'Result',
array(
'PositionFinished' => 'Position Finished',
'PointedScored' => 'Pointed Scored',
'Team.CarNumber' => 'Car Number'
),
'getCMSFields_forPopup'
);
$fields->addFieldToTab("Root.Content.Result Manager",$tablefield);
| 210 Views | ||
|
Page:
1
|
Go to Top |

