tz_com 2011-07-20 14:03:13 4421次浏览 3条回复 0 0 1

在CGridView列表中,我想用ajax+dropdownlist实现状态的修改 如图[attach]255[/attach]

代码如下

<?php
    $this->widget('zii.widgets.grid.CGridView', array(
        'id' => 'post-grid',
        'dataProvider' => $model->search(),
        'filter' => $model,
        'summaryText' => '{start} - {end} 共{count}条记录',
        'pager' => array(
            'class' => 'CLinkPager',
            'header' => '',
            'firstPageLabel' => '首页',
            'prevPageLabel' => '上一页',
            'nextPageLabel' => '下一页',
            'lastPageLabel' => '末页',
        ),
        'columns' => array(
            'id',
            'title',
            'content',
            'tags',
            array(
                'name' => 'status',
                'value' => '$data->PostStatus',
            ),
            array(
                'name' => 'create_time',
                'value' => 'date("Y-m-d", $data->create_time)',
            ),
            array('header' => '状态管理',
                'type' => 'raw',
                'value' => 'CHtml::dropDownList("ddl",$data->status,array("1"=>"草稿","2"=>"发布","3"=>"过期"),array(
                "ajax"=>array(
                                 "type"=>"POST",
                                 "url"=>Yii::app()->createUrl("post/updateStatus",array("id"=>$data->id))
                             )
                  ))'
            ),
            array(
                'class' => 'CButtonColumn',
            ),
        ),
    )); ?>

为什么 不触发post/updateStatus这个方法呢? 求解答~~

您需要登录后才可以回复。登录 | 立即注册