<?php
 Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/plugins/jquery-ui-1.8.16.custom.min.js');
 
$titulacionFormConfig = array(
      'elements'=>array(
        'titulacion'=>array(
            'type'=>'dropdownlist',            
            'layout'=>'{input}',
            'class'=>'fullwidth',
            'items'=>array_merge(
                    array(''=>'-'),
                    CHtml::listData(Titulacion::model()->findAll(), 'descripcion', 'descripcion')
            ),
            
        ),
    ),
    );
?>


    <div class="padding1020">
        <label><?php echo Yii::t('intranet', 'Titulaciones'); ?></label>

        <div class="marginleft150">
            <?php $this->widget('ext.multimodelform.MultiModelForm',array(
                    'id' => 'id_titulacion', //the unique widget id
                    'addItemText' => '', // no quiero mostrar el enlace de añadir
                    'removeText' => 'Eliminar',
                    'removeConfirm' => '¿Desea eliminar esta titulación?',
                    'tableHtmlOptions' => array(
                        'class' => 'sTable2 lf',
                    ),
                    'tableView' => true,
                    'formConfig' => $titulacionFormConfig, //the form configuration array
                    'model' => $titulacion, //instance of the form model

                    //if submitted not empty from the controller,
                    //the form will be rendered with validation errors
                    'validatedItems' => $titulacionesValidas,

                    //array of member instances loaded from db
                    'data' => $titulacion->findAll('candidato_id=:candidato_id', array(':candidato_id'=>$model->id)),

                    'removeHtmlOptions' => array(
                        'class' => 'button plain',
                    ),
                ));
            ?>
            <br clear="all" />
            <div class="mmf_addlink">
            <?php                
                echo CHtml::link('Añadir titulación', '#', array(
                            'class' => 'button plain',
                            'rel' => '.id_titulacion_copy',
                            'id' => 'id_titulacion',
                            ));

            ?>
            </div>
            <br clear="all" />
        </div>
    </div>


