1

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

这有效

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']
        ),                      
    )); 
4

1 回答 1

1

好的,找到了解决方案

这行得通

<?php  
      echo $this->Js->link('Delete', 
                                array(
                                   'action' => 'edit_reload',
                                   'team_id'=>$team['Team']['id']
                                 ), 
                                 array(
                                   'update' => '#success'
                                 )
                          ); 
?>  
于 2012-04-29T19:51:04.950 回答