hi guys i've a table field inside my dataobject... but the table works badly.... when delete one record ... my dataobject show white... and when i add a record a ive a checkbox... this checkbox show enable but.. disable others chebox in table why?
<?php
// /mysite/code/Divisao.php
class Divisao extends DataObject {
static $db = array (
'Nome' => 'Varchar(255)'
);
static $has_one = array (
'ObraPage' => 'ObraPage'
);
static $has_many = array (
'Detalhes' => 'Detalhe'
);
public function getCMSFields_forPopup()
{
if( $this->ID == NULL ){
return new FieldSet(
new TextField('Nome','Assoalhada')
);
} else{
return new FieldSet(
new TextField('Nome','Assoalhada'),
new TableField(
//'Detalhes',
'Detalhes',
'Detalhe',
array('Nome' => 'Nome', 'Estado' => 'Estado'),
array('Nome' => 'TextField', "Estado" => "OptionsetField('Estado','Estado',singleton('Detalhe')->dbObject('Estado')->enumValues())" ),
"DivisaoID",$this->ID
//"DropdownField('Estado','Estado',singleton('Detalhe')->dbObject('Estado')->enumValues())"
....
<?php
class Detalhe extends DataObject {
static $db = array (
'Nome' => 'Varchar(255)',
"Estado" => "Enum('Caracteristica,Acabamento','Caracteristica')"
);
static $has_many = array (
);
static $has_one = array (
'Divisao' => 'Divisao'
);
}