Simple GridView extension with jquery ui sortable.
Add column sort (intval) to your table.
Add code to your model:
public function behaviors() { return array( 'sortable' => array( 'class' => 'ext.sortable.SortableBehavior', ) ); }
Add code to your controller:
public function actions() { return array( 'sortable' => array( 'class' => 'ext.sortable.SortableAction', 'model' => YourModel::model(), ) ); }
Replace:
$this->widget('CGridView', array(
to:
$this->widget('SortableGridView', array(
On github: https://github.com/Troytft/weee-cms/tree/master/protected/extensions/sortable
Total 6 comments
Hi guys. I fixed some errors into this extension. And add Pull request to author. You can use my report https://github.com/igorska/weee-cms/tree/master/protected/extensions/sortable untill author not approve my bugs fixes
jQueryUI exists? version?
I am getting an error in firebug:
Can you help ?
Resolved :)
Just include this snippet to include jquery.ui library in the view :
http://www.yiiframework.com/extension/sortable/files/sortable.zip , see "Downloads" on sidebar.
Where is source of extension?
Leave a comment
Please login to leave your comment.