Yii Framework Forum: [EXTENSION] EMultiSelect - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] EMultiSelect Rate Topic: ****- 1 Votes

#21 User is offline   dowerasu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 15-August 12

Posted 18 August 2012 - 05:54 AM

Hi all,

I am not sure what I'm doing wrong, but I don't see my list elements. Although title attribute is set correctly.

my view:

$this->widget('application.extensions.emultiselect.EMultiSelect',array('sortable'=>true, 'searchable'=>true));
    	echo $form->dropDownList($task, 'members', CHtml::listData($members, 'id', 'fullname'),
    		array('multiple'=>'multiple', 'key'=>'members', 'class'=>'multiselect'));



where $task - my model, $members - available array of models, members - empty $members array for selected items, id and fullname - $members attributes.

Please help.
0

#22 User is offline   dowerasu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 15-August 12

Posted 25 August 2012 - 07:51 AM

I got it. Yii form style was blocking it from showing members.
0

#23 User is offline   dowerasu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 15-August 12

Posted 31 August 2012 - 09:04 AM

Hi all,

How to get some elements pre selected based on condition.

Thanks in advance.
0

#24 User is offline   Sukhwinder 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 27-October 09

Posted 21 December 2012 - 04:42 AM

View PostLoren, on 12 May 2011 - 11:19 AM, said:


Hi Thanks for nice extension
I am facing one issue with this, the extension is running but without CSS only black and white and no effect, what may be the reason? kindly see the attachment
0

#25 User is offline   internetnick 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 18-January 13

Posted 23 January 2013 - 02:43 PM

Hi,
I have a question about EMultiSelect. I want to use two emultiselects (or dropdown or what you wanna call it) at the same page and from the same model. Is it possible to differ the responses in anyway? How?


Thanks for a great extension, works perfect!
0

#26 User is offline   Nur Rochim 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 04-February 13
  • Location:Indonesia

Posted 04 April 2013 - 07:53 AM

wow .. I like this extension. thank you
0

#27 User is offline   Gillz 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 08-June 11

Posted 09 April 2013 - 09:19 AM

I've got the same question as Dowerasu. Is it possible to pre select items and how?


Fix it:
	$array = array();
	foreach($qAdacrbActive as $arr){
		$array[$arr['adacrt_ID']] = array("selected"=>true); //add the ids that you want to pre select
	}
	
	echo CHtml::dropDownList(
			$model,
			'Faxxuh',
			$listAdacrtAccoRoomType,
			array(
				'multiple'=>'multiple',
				'key'=>'ID',
				'class'=>'multiselect' ,
				'options'=>$array, // add it to the options var
			)
		);

This post has been edited by Gillz: 09 April 2013 - 09:54 AM

0

#28 User is offline   sifa786 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 12-February 13

Posted 11 April 2013 - 03:01 PM

Hi - how does one load the values in the update form again?

View PostLoren, on 26 May 2011 - 10:08 PM, said:

I recommend using foreign keys in a separate table to save things like this.
In which case, you would probably be using a manymany relation so this behavior can also help with saving: http://www.yiiframew...ons-ar-behavior
Then, Yii can autoselect things for you. (Use the key option for the dropdown.)

Eg In _form.php
<?php
    	$post=Trainingo::model()->findAll();
    	$trainings = CHtml::listData($post, 'training_id', 'name'); // Get the list of options
    	echo $form->dropDownList(
        	$model,
        	'trainingosCall',
        	$trainings,
        	array(
            	'multiple'=>'multiple',
            	'key'=>'training_id', // The id from the table
            	'class'=>'multiselect',
        	)
    	);
?>

In model relations function:
'trainingosCall' => array(
  	self::MANY_MANY,
  	'Trainingo',
  	'call_trainingo(call_id, trainingo_id)'
),


Note: I have a table call_trainingo with 2 columns call_id and trainingo_id to relate them.

Then to save (using the behavior above also):
        	$model->attributes=$_POST['Call'];
        	if (!is_array(@$_POST['Call']['trainingosCall'])) {
            	$_POST['Call']['trainingosCall2'] = array();
        	}
        	$model->setRelationRecords(
            	'trainingosCall', $_POST['Call']['trainingosCall']
        	);
        	$model->save();


0

#29 User is offline   andres101 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 12-April 13

Posted 12 April 2013 - 08:19 AM

Thank you for making this extension! It works flawlessly on Yii V1.1.10.

I get a javascript error on Yii V1.1.13 when I open the dropdown. I'm using Chrome Version 26.

TypeError: Property '400' of object #<Object> is not a function <snip>/assets/ab3864ac/jquery.js:8943]


if ( this.options.duration ) {
    this.pos = eased = jQuery.easing[ this.easing ]( //this line raises the exception
        percent, this.options.duration * percent, 0, 1, this.options.duration
    );

0

#30 User is offline   Johnny Gan 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 198
  • Joined: 30-May 13

Posted 30 August 2013 - 04:26 PM

Shared code: how to insert emultiselect into CForm. I try to add my screen shot, but here is no function to support that, so I create a new topic below, and add the link here.
http://www.yiiframew...elect-in-cform/
0

#31 User is offline   cristianvaldesr 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 09-October 13

Posted 28 November 2013 - 10:59 AM

Works great!
Only one problem. If i got a few elements added, when i update and remove them all, it doesnt work. It only work when i remove all but one.
When i got one element, and update and try to remove that element, doesnt work either.
It always fail when i remove all the items and leave it empty.

Anyone else with this problem??

I use it for add profiles to a user.
My DB its like this

user(id, ...) - user_profil(user_id, profil_id) - profil(id, ....)


PS: Sorry for my english.
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • 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