dongxu1668 2013-12-17 12:59
浏览 29
已采纳

Yiic Grid视图总是给予直播不是一个功能

I know live has been deprecated. Now I am using Yii grid view and i have following code:

   $this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'category-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        'title',
        array(
            'class' => 'CButtonColumn',
            'viewButtonUrl' => 'Yii::app()->createUrl("/shop/category/view",
            array("id" => $data->category_id))',
            'updateButtonUrl' => 'Yii::app()->createUrl("/shop/category/update",
            array("id" => $data->category_id))',
            'deleteButtonUrl' => 'Yii::app()->createUrl("/shop/category/delete",
            array("id" => $data->category_id))',
        ),
    ),
));

On the browser it gives me error:

typeError: jQuery(...).live is not a function
[Break On This Error]   

jQuery('#category-grid a.delete').live('click',function() {

I am confused as i have searched the entire folder for .live function but i cant find it. Please help!

  • 写回答

3条回答 默认 最新

  • drake900918 2013-12-18 05:54
    关注

    I think this is because of the version of Yii. It may be using .live() which is deprecated.

    One Possible solution can be you go to yii/framework/zii/widgets/grid and edit CButtonColumn.php

    In this replace .live() by .on()

    I think then it should work.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 怎样才能让鼠标沿着线条的中心线轨迹移动
  • ¥60 用visual studio编写程序,利用间接平差求解水准网
  • ¥15 Llama如何调用shell或者Python
  • ¥20 谁能帮我挨个解读这个php语言编的代码什么意思?
  • ¥15 win10权限管理,限制普通用户使用删除功能
  • ¥15 minnio内存占用过大,内存没被回收(Windows环境)
  • ¥65 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?