Yii 1.1: sortable

CGridView with jQueryUI sortable

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(),


$this->widget('CGridView', array(


$this->widget('SortableGridView', array(

On github: https://github.com/Troytft/weee-cms/tree/master/protected/extensions/sortable

Total 8 comments

#13413 report it
yatskanich.sasha at 2013/05/28 03:46am
some problem

It's work very well and easy to install, but only on first page of grid view. I click to next page and it's not work.

I disabled ajaxUpdate in grid view and now it's works in all pages, but now my grid view without ajaxUpdate.

How i can to fix it

#13317 report it
sefburhan at 2013/05/22 08:00am

any Demo to check and compare with our requirement? is it working with relationship variable?

#12925 report it
igorska at 2013/04/21 06:33am
Error fix

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

#12779 report it
爱老虎油 at 2013/04/11 10:02pm
YiiBase::include(SortableColumn.php) [<a href='yiibase.include'>yiibase.include</a>]: failed to open stream: No error
#9526 report it
Troy at 2012/08/20 01:44pm
reply to #9525

jQueryUI exists? version?

#9525 report it
johonunu at 2012/08/20 01:13pm
Error in javascript

I am getting an error in firebug:

TypeError: $(".sortable-clipboard-area").sortable is not a function
[Break On This Error]   
connectWith : '.sortable-items tbody'

Can you help ?

Resolved :)

Just include this snippet to include jquery.ui library in the view :

<?php Yii::app()->clientScript->registerCoreScript('jquery.ui'); ?>
#9522 report it
Troy at 2012/08/20 08:30am
reply to #9520
#9520 report it
dvapelnik at 2012/08/20 07:42am

Where is source of extension?

Leave a comment

Please to leave your comment.

Create extension