The JQuery UI Tagger widget allows your users to enter a bounded or unbounded list of attributes in a text field in a "comma separated" way. Forming tags in process. For example:

Or in the bounded case:

The tags are formed just after the "," is pressed.
Yii 1.1 or above
Extract the contents of the zip file directly into protected/extensions/
echo CHtml::label("Tags for your post:","widget"); $this->widget('ext.ETagger.ETagger', array('name'=>'widget'));
echo CHtml::label("Enter your 5 favorite car manufacturers:","widget3"); $this->widget('ext.ETagger.ETagger', array( 'name'=>'widget3', 'keywords'=>array('Ferrari','Audi','BMW','Nissan'), 'width'=>'500px', 'limit'=>5, 'options'=> array( 'useColorFunction'=>true, 'colorFunction'=>'js:function(label) { switch (label) { case "Ferrari": return {font:"#FFF", background:"#D32232"}; case "BMW": return {font:"#FFF", background:"#2F749E"}; case "Audi": return {font:"#C1C1C1", background:"#505962"}; case "Nissan": return {font:"#FFF", background:"#274A84"}; default: return{font:"#FFF", background:"#318038"}; } }', 'closeChar'=>'o', ), ));
$model = User::model()->findByPk(1); $this->widget('ext.ETagger.ETagger', array( 'model'=>$model, 'attribute'=>'interests', 'width'=>'300px', 'options'=> array( 'closeChar'=>'X', ), ));
It should work in conjunction with jquery ui autocomplete extension
The following parameters are accepted by the widget:
JQuery UI Tagger project page
Demo: TODO
Total 4 comments
Hi, thanks for share, small sample for autocomplete cases?
hi. Problem in file extract "ETagger-v0.1.zip"
First "out of the box" test : it works just fine !
Good work denn1s ... and thanks for this extension
This is my very first extension, so comments and recommendations will be very appreciated. Just please try to be gentle.
Recommendations for the JQuery UI widget will be relied to the author.
Leave a comment
Please login to leave your comment.