rsortdropdownlistwidget display a dropDownList with sort link for CSort class

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

0 2
5 followers
343 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: User Interface
Developed by: Rsol
Created on: Oct 28, 2011
Last updated: 6 years ago

Downloads

show all

Related Extensions