This extention represent sortable CGridView

RGridViewWidget
RGridViewWidget displays a list of ordered data items in terms of a table. This widget based on CGridView widget. You can order your model drageble.
$this->widget('ext.RGridViewWidget.RGridViewWidget', array( 'dataProvider'=>$dataProvider, 'rowCssId'=>'$data->id', 'orderUrl'=>array('order'), 'successOrderMessage'=>'Success', 'buttonLabel'=>'Order', 'template' => '{summary} {items} {order}', 'options'=>array( 'cursor' => 'crosshair', ), 'columns'=>array( ... ), ));
Options:
RGridViewAction
RGridViewAction store the ordered models.
To use RGridViewAction add it in your controller:
public function actions() { return array( 'order' => array( 'class' => 'ext.RGridView.RGridViewAction', 'model' => 'Model', 'orderField' => 'order', ), ); }
Sourse: https://github.com/RSol/RGridView
P.S. In future use CJuiSortable
Total 11 comments
Sorry... My fault.
In new project I excluded short-link class Y.
New corrected extention is v.0.3.
Thank you for your comments.
This extension works well once a few characters are added: in github source lines 52 53 looks like something slipped and deleted a few characters:
should be more like
This will allow saving the updates... then it works well. Nice!
2 things to check in your controller:
make sure you have added 'order' to the allowed actions in accessRules; and
you have set your model and order field here:
Hope that helps.
Have your table primary key? I there one field or more?
Give more information: see what answer geve server (use firebug for firefox ore other browser tools for ajax discover).
My skype: slavarud
I can't get the save button to work. Seems to have something to do with lines 50-58 in RGridViewAction.php
I keep getting an html 500 error.
Can you help? What additional information do you need?
Other than this "little" issue, I love the extension.
thanks, it is a very useful hint
each page of pager will be a separate table list and connected through some session value :)
hi shahidmau
create your own poket - just save data in user session and fow UI use two connected sortable
hi Rsol, thanks for quick reply...
I solved point number 2 and 3 myself, i modified code in actionOrder method, but point no.1 is still pending.
Yes, I known. For this perpers I create other extentions, but I can't give it in public - I creating it for other man. For draggin elements beetwin pages I use "poket". User put one or more elements in poket and it shown in each pages of greed. And elemet removed form poket when user put elements in greed.
You shoild use successOrderMessage property for this perpes. If you need other js action (no "alert") - just in line 136 of file "RGridViewWidget.php" change it.
Can you give more information about this point.
hi, it is so nice, but i am facing few problems
1) i am not able to use it with pager (it is very necessary)
2) i am not able to show success msg after updating the row
3) it gives js error "ansver is null" when i see in firebug
plz solve these problems(specially point no.1) and extend usage documentations if possible
thanks for providing an useful extension...
I was just planning on building something like this myself, you saved me a lot of time :D
Leave a comment
Please login to leave your comment.