Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Changing Dropdownlist For Readonly When Editing

$
0
0
Hi
I'm new, coming from CaVisualObjects,

The question is I'm trying change an external related field creating combo when inserting a new register by a readonly textfield when editing existing.
The trouble is coding the else statement of the IF isnewrecord sentence.

I think code lines explain it better than my english:

<?php if($model->isNewRecord)
{echo $form->dropDownListRow($model, 'genorganizacion_id', CHtml::listData(Genorganizacion::model()->findAll(), 'id', Genorganizacion::representingColumn()));}

else{echo CHtml::encode($data->genorganizacion->nombre); }?>

This code works well when creating new records but editing (else sentence), because it renders nothing when editing

What 'd be the solution?

Tia

EdSolano

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>