您的位置:首页 > 编程语言 > PHP开发

Yii Framework 开发教程(46) Zii组件-Sortable示例

2013-01-08 08:23 295 查看

CJuiSortable显示一个列表,列表中的列表项可以通过拖放重新调整顺序,它封装了JUI Sortable插件。

其基本用法如下:

<?php
Yii::app()->clientScript->registerCss('sortable', "
#sortable {list-style-type: none; margin: 0; padding: 0; width: 60%;}
#sortable li {margin: 2px; padding: 4px;
border: 1px solid #e3e3e3; background: #f7f7f7}
", 'screen', CClientScript::POS_HEAD);
?>

<h2><?php echo Yii::t('ui','Sortable');?></h2>

<?php $this->widget('zii.widgets.jui.CJuiSortable', array(
'id'=>'sortable',
'items'=>array(
'id1'=>'Item 1',
'id2'=>'Item 2',
'id3'=>'Item 3',
),
'options'=>array(
'cursor'=>'n-resize',
),
));
?>

本例下载


阅读更多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: