yii-joblo / multimodelform

Yii extension multimodelform
13 stars 9 forks source link

column header and copy template is missing when using dropdownlist #2

Open uniconstructor opened 11 years ago

uniconstructor commented 11 years ago

copy template and table header (when using table view) is empty by default. Clicking "add item" link adds only remove link and nothing more.

I found a solution by forcing "visible" attribute for every form element:

public function formConfig()
{
    return array(
        'elements'=>array(

            'event'=>array(
                'type'=>'text',
                'maxlength'=>255,
                'visible' => true, // copy template is empty without it!
            ),

            'year'=>array(
                'type'=>'dropdownlist',
                'items'=>array(''=>'-',2009=>2009,2010=>2010,2011=>2011,),
                'visible' => true, // copy template is empty without it!
            ),
        ));
}