简体   繁体   中英

Yii jQuery BBQ error after delete

I am using Yii CGridView . There is delete buttons in a column:

array(
    'class'=>'CButtonColumn',
    'template' => '{update}{delete}',
    'buttons' => array(
        'delete' => array(
            'imageUrl' => false,
            'options' => array( 'class'=>'btn btn-danger btn-mini delete-button' ),
        )
    ),
)

After clicking delete button i see ajax request and directly after that I got js error

"URL is undefined" from jquery.ba-bbq.js @ 257 line (matches = url
 .match( is_fragment ? /^([^#]*)\#?(.*)$/ : /^([^#?]*)\??([^#]*)(#?.*)/ );).

Does anyone have any idea how to get rid of that error?

Ps entry is deleted, only js error.

Ok, i found solution here :

Overwrite CGridView registerClientScript with this one:

public function registerClientScript(){

    //if ajaxUrl not set, default to the current action
    if(!isset($this->ajaxUrl))
        $this->ajaxUrl = Yii::app()->controller->createUrl("");

    //call parent function
    parent::registerClientScript();
} 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM