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',
),
),
));
User Contributed Notes 3
?
Do you mind adding a little more documentation? maybe a demo?
little more documentation
I adding little more documentation. In the near future I will do the demo.
This widget looks like "CHtml::dropDownList"
:)
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
Leave a comment
If you have any questions, please ask in the forum instead.
Join the conversation to share a note.