JS帮助程序提交工作,但链接不会

时间:2012-04-29 18:29:40

标签: cakephp cakephp-1.3 cakephp-2.0

我需要使用链接而不是在JS帮助器中提交。不幸的是我的提交代码工作正常,但当我尝试通过更改$ this-> Js->提交到$ this-> Js->链接它不起作用时将相同的代码从提交切换到链接

此作品

echo $this->Js->submit("Delete", array(
    'before'=>$this->Js->get('#sending')->effect('fadeIn'),
    'success'=>$this->Js->get('#sending')->effect('fadeOut'),
    'update'=>'#success',
    'url' => array(
    'action' => 'delete',$team['Team']['id']
    ),                      
));

这不起作用

 echo $this->Js->link("Delete", array(
        'before'=>$this->Js->get('#sending')->effect('fadeIn'),
        'success'=>$this->Js->get('#sending')->effect('fadeOut'),
        'update'=>'#success',
        'url' => array(
        'action' => 'delete',$team['Team']['id']
        ),                      
    )); 

1 个答案:

答案 0 :(得分:1)

确定找到了解决方案

这是有效的

<?php  
      echo $this->Js->link('Delete', 
                                array(
                                   'action' => 'edit_reload',
                                   'team_id'=>$team['Team']['id']
                                 ), 
                                 array(
                                   'update' => '#success'
                                 )
                          ); 
?>