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

Giix Dropdownlist + Nestedsetbehavior + Virtual Attributes +  's

$
0
0
Hi Guys,

I don't know if anybody has faced such a situation, but I can't really find relevant info on the net.

I'm using Giix and nestedsetbehavior.

based on this Wiki: Understanding Virtual Attributes and get/set methods

I made a virtual attribute:
public function getNbspName() {
    return str_repeat(html_entity_decode(" "), $this->level*4) . $this->name;
}


this way, in the view, it looks as I want.

The problem: I wanted to echo the variable NbspName in the related table's create form, to kinda have the same tabbed design in the dropdown:
<?php echo $form->dropDownList($model, 'foreign_id',
GxHtml::listDataEx(Model::model()->findAllAttributes(null, true), 'id', 'NbspName')); ?>


why is it not rendered in the dropdown list the same way, with visible nbsps? If I put nbsps manually into a select list, it is rendered, so the problem is somewhere else.
And the order of data is also not correct.
Or should I try a different approach?

Thanks!
c

Viewing all articles
Browse latest Browse all 18717

Latest Images

Trending Articles



Latest Images

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