English 中文(简体)
CakePHP Ajax ——Ajax 电话
原标题:CakePHP Paginator with Ajax - Ajax calls aren t being called

I m 采用CakePHP 建造在出租车助手里,在试图与Ajax结合时遇到了问题。

实际缔造者(即:

echo $this->Paginator->prev( « Previous , null, null, array( class  =>  disabled ));

echo $this->Paginator->next( Next » , null, null, array( class  =>  disabled )); 

施工和工作罚款。 然而,它使该网页重载,我实际上不想这样做。 它使用文件,说使用了以下代码:

$this->Paginator->options(array(
     update  =>  #testtable ,   // This is the name of the table to be refreshed
     evalScripts  => true
));

但是,当我去点击这些链接时,它仍然只是重载该网页。 它完全无视这些选择。 可在网页上查到,因为还有其他Ajax电话被打上同一页,我竭力想什么是错的?

问题回答

在你看来,在档案或布局档案中添加以下文字,并审判

jQuery(document).ready(function() {  
  jQuery( #example ).dataTable( {
    "sPaginationType": "full_numbers",
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": src="<?= $this->base;?>/controller/action/<?=$dataId;?>",    
});

这可能会使阿贾克斯功能增加至想象力。

我建议你使用面包店的粉饰片。 Cakephp-DataTable

这一假想已经落实了这一设想,而且大多数特征都是在缺席的情况下出现的。 他们还提供了文件,如果你发现在执行方面遇到任何困难,请通过

此外,开发商非常积极,如果你有的话,可以澄清这一gin。

我以前曾遇到过同样的问题。 这样做是为了建立我自己的支部,而是约束职能。 我删除了<代码>$this->Paginator->options(。

      $( .prev a, .next a ).bind( click , function(event){
        event.preventDefault();

        var url_link = $(this).attr( href );
        $.ajax ({ async:true, 
            beforeSend: function (XMLHttpRequest) {$("#busy-indicator").fadeIn();}, 
            complete: function (XMLHttpRequest, textStatus) {$("#busy-indicator").fadeOut();}, 
            dataType: "html", evalScripts:true, 
            success: function (data, textStatus) {   
                $("#testtable").empty().html(data);
            }, 
            url: url_link});
            return false;

        });        




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签