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

Problem Mit Select2 Extention With Multiply

$
0
0
@patsch1980

Hi folks,

I'm trying to get the select2-ext running for hours now, but I didn't get it right to fit my needs :unsure:

I've downloaded the last version from the yii-extention site...

The demo codes works very well but if I change it to my needs I don't work as desired.

My needs: Multiply without tags.

        $data=array(
        '1'=>'Satu',
        '2'=>'Dua',
        '3'=>'Tiga',
        );
        // Multiple data
            $this->widget('ext.select2.ESelect2',array(
              'name'=>'name_of_the_component',
                'data'=>$data,
              'htmlOptions'=>array(
                'multiple'=>'multiple',
              ),
            ));



If I POST the data, I'm always only get the last selected value in the variable 'name_of_the_component' (e.g. name_of_the_component => "2")

If I enable the tags, it works, but I don't want the user to input new values...

If I enable the model with:

            $this->widget('ext.select2.ESelect2',array(
              'name'=>'[i]name_of_the_component[/i]',
                'data'=>$data,
                'model'=>$model,
            'attribute'=>'itemnumber',

              'htmlOptions'=>array(
                'multiple'=>'multiple',
              ),
            ));


...then the component isn't rendered correct -> it get rendered as plain "html"-components (listfield, see attached image), but all values are listed as csv in a POST (e.g. content of the variable itemnumber => "Satu,Dua")

Is this a bug or what am I doing wrong??

Thanks for reading ;-)

  • : Screenshot from 2013-01-26 13:12:30.png

Viewing all articles
Browse latest Browse all 18717

Trending Articles



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