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

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

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

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

                    //array of member instances loaded from db
                    'data' => $capacidad->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 capacidad', '#', array(
                            'class' => 'button plain',
                            'rel' => '.id_capacidad_copy',
                            'id' => 'id_capacidad',
                            ));

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