简体   繁体   English

Umbraco Ajax加载更多

[英]Umbraco Ajax load more

Please can anyone help me . 请任何人能帮助我。 I am trying to use Ajax for to load more calendar event thats coming from my umbraco backend . 我正在尝试使用Ajax加载来自我的umbraco后端的更多日历事件。 from this code below 从下面的代码

在此处输入图片说明

my calendar 我的日历

在此处输入图片说明

i don't know how to do this but i want to make an Ajax call such that on click of the load More button .. i send to my controller to retrieve the model instead instead of the foreach statement above and then do something with the model retrieved by 我不知道如何执行此操作,但我想进行一次Ajax调用,以便在单击“加载”更多按钮时..我发送到控制器以检索模型,而不是上面的foreach语句,然后使用检索的模型

[HttpPost]
    public ActionResult LoadEvent(int number)
    {
        var model = Umbraco.Content(1121).eventDetails;

        return model;
    }

My SmartController is located inside App_Code folder . 我的SmartController位于App_Code文件夹中。 Below is the Ajax am working on 以下是Ajax正在开发的

 $(document).ready(function (e) {

    $(".buttonListener").click(function () {

            //  e.preventDefault();
            $.ajax(
            {

                url: "/SmartController/SmartSurface",        //"/SmartCalendar",
                data : {number: 1},
                success: function (data) {
                    alert(data);
                },
                error: function () {
                    alert("Ka pow!");
                }
            });
            return true;
    });
});

Please help me somebody .... 请帮助我某人....

i solved this by loading all the events into table that has a tr . 我通过将所有事件加载到具有tr的表中来解决此问题。 I hid the TR via javascript 我通过JavaScript隐藏了TR

  $(".eventtables, .eventmonth").hide(); 

and i show each one with 我给每个人展示

            $(".Cal_loadmorediv").slice(0,2).show();

That solved it . 那解决了。 so it shows the first two onclick of the loadmore button 因此它显示了loadmore按钮的前两个onclick

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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