douza1373 2018-12-02 12:41
浏览 204

jQuery FullCalendar下一个按钮不显示周视图事件(ajax)

I'm working on a calendar that fetches data from an immensely populated database (more than 10,000 records). This has made the application extremely slow to load.

In view of this, I am trying to implement via AJAX (json) a search for weeks.

I've already been able to load the current week via AJAX, but when I click the prev or next buttons, the adjacent weeks are empty.

From what I read in the documentation, these buttons would continue sending the startParam and endParam variables, but this is not happening.

My code is jammed and full of php patches, but it works perfectly, except for this slowness.

Jquery:

events:{
url: '../ajax/entrada_agenda.php',
type: 'GET',
dataType: 'json',
data: {
        startParam: <?=strtotime($FirstDayWeek)?>, 
        endParam: <?=strtotime($LastDayWeek)?>, 
    },
}

,

And in the PHP page I make a select with the dates sent (already converted to UNIX).

SELECT * FROM agenda_marcacao WHERE DATE(data_do_agendamento) >= '".$data_start."' AND DATE(data_do_agendamento) <= '".$data_end."'

$data_start and $data_end are variables populate like this:

$data_start = date("Y-m-d", $_GET['start']); 
$data_end = date("Y-m-d", $_GET['end']); 

Is there any way I can indicate on the prev and next buttons these start and end values for weeks?

Because of what I see, FullCalendar will not interpret that I want to pick up the events of the weeks only when prompted, not the entire database ...

Any help will be greatly appreciated, thanks :)

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 thinkphp6配合social login单点登录问题
    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch