update database with juisortable

i want to update field in db with juisortable but i was stuck here for 3days…

i have this in my view


    // Organize the dataProvider data into a Zii-friendly array

   $items = CHtml::listData(HelpContent::model()->findAllBySql('select * from help_content where id_help_menu = '.$_GET['id'].' order by weight asc'), 'id_help_content', 'name');



    // Implement the JUI Sortable plugin

    $this->widget('zii.widgets.jui.CJuiSortable', array(

        'id' => 'item',

        'items' => $items,


    'itemTemplate'=>'<li id="{id}" class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>{content}</li>',









                                type: 'POST',

                                url: '{$this->createUrl('helpContent/sort')}',

                                 data: $(this).sortable('serialize'),								









im my controller

public function actionSort()


            foreach ($_POST['id'] as $position => $item)


            	$content = HelpContent::model()->findByPk($item);

            	 $content->weight = $position;

            	 return $content->save();



            	$sql = 'update help_content set weight = :weight

                                    	where id_help_content = :id_help';







my rules





what am i doing wrong???

please your help…

thanks in advance

What is the exact problem?

What does net tab from firebug show? Are request sent after sorting? What are the server replies? Try using ‘stop’ event instead of update, at lest for sake of testing.

thanks for your respone…

i’ve done with sortable in gridview like tutorial in this link…