Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Table Field

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 700 Views
  • Dr0gaz
    Avatar
    Community Member
    37 Posts

    Table Field Link to this post

    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'
    );

    }

  • UncleCheese
    Avatar
    4085 Posts

    Re: Table Field Link to this post

    Yeah, I don't think that's ever going to work. Way too many dependency conflicts.

    700 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.