I need to add a HasManyComplexTableField to a popup block,
Can I do this?
<?php
class Concert extends DataObject{
static $db = array(
"Content" => "Text"
);
static $has_one = array(
"Ticket" => "TicketsPage"
);
static $has_many = array(
"Seats" => "Seat"
);
function getCMSFields_forPopup(){
$fields = new FieldSet();
$fields->push(new TextField( 'Content', 'Content' ));
$tablefield = new HasOneComplexTableField(
$this,
'Seats',
'Seat',
array(
'Content' => 'Content',
'Price' => 'Price'
),
'getCMSFields_forPopup'
);
$tablefield->setAddTitle('Seats');
$fields->push($tablefield);
return $fields;
}
}
?>
this is my code