Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Button 标题中的Fullcalendar自定义按钮_Button_Header_Fullcalendar - Fatal编程技术网

Button 标题中的Fullcalendar自定义按钮

Button 标题中的Fullcalendar自定义按钮,button,header,fullcalendar,Button,Header,Fullcalendar,我需要在同一页面上的两个(或多个)完整日历之间切换,并希望将此功能添加到日历标题内的自定义按钮 我在自定义按钮上发现了一些有趣的代码,但它有点过时,因为它引用了FullCalendarV1.6.1,而我使用的是2.3.1 这就是我所发现的:后来。 我几乎成功地实现了这一点:但是脚本被重新编写,并且与此代码不匹配 任何人如果有适用于2.3.1的自定义按钮的更新代码,请查看计划程序中的示例: // ad-hoc way of getting an add button in there. // fo

我需要在同一页面上的两个(或多个)完整日历之间切换,并希望将此功能添加到日历标题内的自定义按钮

我在自定义按钮上发现了一些有趣的代码,但它有点过时,因为它引用了FullCalendarV1.6.1,而我使用的是2.3.1

这就是我所发现的:后来。 我几乎成功地实现了这一点:但是脚本被重新编写,并且与此代码不匹配


任何人如果有适用于2.3.1的自定义按钮的更新代码,请查看计划程序中的示例:

// ad-hoc way of getting an add button in there.
// for a better solution, please star this issue:
//  https://code.google.com/p/fullcalendar/issues/detail?id=225
$('.fc-toolbar .fc-left').prepend(
    $('<button type="button" class="fc-button fc-state-default fc-corner-left fc-corner-right">+ room</button>')
        .on('click', function() {
            var title = prompt('Room name');
            if (title) {
                $('#calendar').fullCalendar(
                'addResource',
                { title: title },
                true // scroll to the new resource?
             );
        }
    })
);
//获取添加按钮的特殊方式。
//为了获得更好的解决方案,请将此问题标记为星号:
//  https://code.google.com/p/fullcalendar/issues/detail?id=225
$('.fc toolbar.fc left')。前缀(
$(“+房间”)
.on('单击',函数()){
变量标题=提示(“房间名称”);
如果(标题){
$(“#日历”).fullCalendar(
“添加资源”,
{title:title},
true//是否滚动到新资源?
);
}
})
);

此处:

fullcalendar插件已经支持标题中的自定义按钮。不需要添加特殊代码

$("#calendar").fullCalendar({
    customButtons: {
        reload: {
            text: 'Reload',
            click: function() {
               //you code 
            }
        }
    },
    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'reload'
    },
 });

是的,这是正确的,但是,我们可能无法添加自定义按钮,如下拉列表或选择框等。