problem with activeDropDownList about length of text

HI,

I have problem to handle long text in activeDropDownList. Can you help me how to break with two lines if text is long?

Here is my code

echo CHtml::activeDropDownList($model,‘title’,CHtml::listData(Books::model()->findAll($criteria),‘id’,‘name’),array(‘prompt’=> ‘Please select this field’));

THanks

Nemo

i think maybe you have to findAll first and then use foreach to do it…and then assign to activeDropDownList()

Yes, I did, but problem is couple of data are too long. My question is, can I break the line and fit my table. Right now my table is out of shape because of this problem.

THanks

Nemo

how about using css to set the width of the dropdownlist?

If you don’t mind, can you send me the example using css in dropdownlist?

THanks

Nemo

here is the html example

<select style="width:200px">

</select>

you can set it as




echo CHtml::activeDropDownList($model,'title',CHtml::listData(Books::model()->findAll($criteria),'id','name'),array('prompt'=> 'Please select this field', 'style'=>'width:200px'));



Thanks

Nemo