如何通过代码触发“今天”按钮的单击?

时间:2011-03-22 12:22:21

标签: fullcalendar

如何通过FullCalendar中的代码触发点击“今天”按钮?如果我通过外部按钮在哪里?

4 个答案:

答案 0 :(得分:10)

答案 1 :(得分:6)

您可以访问fullCalendar,因此您可以执行以下操作:

$('#external-button').on('click', function() {
    $('#calendar').fullCalendar('today');
}); 

答案 2 :(得分:0)

在没有实际查看代码的情况下,我会假设“Today”按钮被挂接到FullCalendar代码中的JQuery或Javascript方法。 只需调用该方法。

答案 3 :(得分:0)

如果上面发布的documentation URL失效......

  

将日历移动到当前日期。

Scanning dependencies of target florianwolters_catch
[ 20%] Building CXX object florianwolters_catch/CMakeFiles/florianwolters_catch.dir/projects/SelfTest/TestMain.cpp.o
In file included from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/projects/SelfTest/TestMain.cpp:10:
In file included from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch.hpp:47:
In file included from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_impl.hpp:19:
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:63:1: error: version control conflict marker in file
<<<<<<< HEAD
^
1 error generated.
florianwolters_catch/CMakeFiles/florianwolters_catch.dir/build.make:54: recipe for target 'florianwolters_catch/CMakeFiles/florianwolters_catch.dir/projects/SelfTest/TestMain.cpp.o' failed
make[2]: *** [florianwolters_catch/CMakeFiles/florianwolters_catch.dir/projects/SelfTest/TestMain.cpp.o] Error 1
CMakeFiles/Makefile2:110: recipe for target 'florianwolters_catch/CMakeFiles/florianwolters_catch.dir/all' failed
make[1]: *** [florianwolters_catch/CMakeFiles/florianwolters_catch.dir/all] Error 2
Makefile:85: recipe for target 'all' failed
make: *** [all] Error 2
  

今天使用外部按钮的示例:

.fullCalendar( 'today' )