Yii Framework Forum: Select2 Extension Problem - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Select2 Extension Problem CloseOnSelect option Rate Topic: -----

#1 User is offline   S. Alcántara 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 25-March 13

Posted 26 March 2013 - 05:53 AM

Hi guys,

I am using the (very nice) select2 extension. In particular, select2 allows you to specify "closeOnSelect" to false in order to continue picking more elements without having to open the list again for each element. So far, so good. However, I am working with a quite long list and every time I pick up one element, the list goes to the top ... this behavior is very inconvenient, e.g., when the user wants to select consecutive elements in the middle of the list. As a matter of fact, in such a situation I'd rather prefer to switch "closeOnSelect" to true ... since it does not come in very handy indeed. Is there anyway to keep the list at the same position after each selection (avoiding it to rewind to the top)? Please, note that I am a complete "Yiibie". FYI, here is the code I am using:

$this->widget('ext.select2.ESelect2',array(
                    'model'=>$model,
                    'attribute'=>'tviewtags',
                    'data'=>$data,
                    'options'=>array(
                        'width'=>'resolve',
                        'closeOnSelect'=>false,
                    ),
                    'htmlOptions'=>array(
                         'multiple'=>'multiple',
                         'placeholder'=>'Select tags...',
                    ),
                )); 

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users