order.php 1.09 KB
<?php

$this->actionsMenu = array(
    array('label' => 'Управление категориями', 'url' => array('admin'), 'icon' => 'icon-list', 'active' => '/' . $this->id . '\/admin/'),
    array('label' => 'Добавить категорию', 'url' => array('create'), 'icon' => 'icon-plus', 'active' => '/' . $this->id . '\/create/'),
);
?>

<h1>Список</h1>
<br/>
<?php
echo CHtml::beginForm();

$items = CHtml::listData($dataProvider->getData(), 'id', 'i18n.name');

$this->widget('zii.widgets.jui.CJuiSortable',
    array(
        'id' => 'orderList',
        'options' => array(
            'stop' => 'js:function(event, ui) {
                    var val=$("#orderList").sortable("toArray");
                    $("#orderInput").attr("value",val); 
                    }',
        ),
        'items' => $items,
        'htmlOptions' => array(
            'class' => 'user-list'
        ),
    ));

echo CHtml::hiddenField('Order', 'none', array('id' => 'orderInput'));

echo CHtml::submitButton('Сохранить порядок', array('class' => 'btn btn-primary'));
echo Chtml::endForm();
?>