Yii 1.1: rsortdropdownlistwidget

display a dropDownList with sort link for CSort class
5 followers

RSortDropDownListWidget

RSortDropDownListWidget display a dropDownList with sort link for CSort class

Using: ΒΆ

In Controller action:

$sort = new CSort;
$sort->modelClass = 'Product';
$sort->attributes = array(
    'product_price',
    'product_time',
    'product_rate',
    'product_title',
);
 
$products = new CActiveDataProvider('Product', array(
    'criteria' => $criteria,
    'sort' => $sort,
    ...
));
...
 
$this->$render('view',array(
    'model'=>$model,
    'products'=>$products,
    'sort'=>$sort,
));

In your view:

$this->widget('ext.RSortDropDownListWidget.RSortDropDownListWidget', array(
    'sort'=>$sort,
    'labels'=>array(
        'product_price'=>array(
            'asc'=>'Price up',
            'deck'=>'Price down',
        ),
        'product_title'=>array(
            'asc'=>'Alpabet',
            'deck'=>'Alpabet deck',
        ),
    ),
));

https://github.com/RSol/RSortDropDownListWidget

Total 3 comments

#5653 report it
Asgaroth at 2011/10/28 02:27pm
:)

thats better, if you dont have a demo you can publish anytime soon, a screenshot would help, many people (including me) dont feel like downloading/installing/testing just to see what it "looks like", or what it actually "does".

just MO

#5652 report it
Rsol at 2011/10/28 02:01pm
little more documentation

I adding little more documentation. In the near future I will do the demo.

This widget looks like "CHtml::dropDownList"

#5649 report it
Asgaroth at 2011/10/28 11:04am
?

Do you mind adding a little more documentation? maybe a demo?

Leave a comment

Please to leave your comment.

Create extension