调度程序调整大小后,Kendo Scheduler事件不会调整大小并遵循调度程序吗?

时间:2017-04-12 21:15:20

标签: javascript jquery css kendo-scheduler

我们需要在创建/编辑弹出窗口时(通过双击已存在的事件或调度程序上的空闲点)使kendo调度程序可见,因此我们调整调度程序的大小并使弹出窗口适合于现在空间的权利开放了。我使用窗口的打开,关闭,激活和取消激活事件来调整大小,以控制何时调整调度程序的大小。

但是,当它调整大小时,事件保持相同的大小并且不会移动,而周和月视图中的日期会随着调整大小而缩小,使得所有事件都不合适,直到调度程序刷新为止。但是,在调整调度程序大小后刷新时,编辑/创建弹出窗口会关闭,这会引发异常,因为调度程序编辑事件无法再找到编辑html模板中定义的组件...

有没有一种很好的方法来调整调度程序的大小,并且在编辑/创建弹出窗口打开后调整大小?

这是我的窗口事件函数,用于打开,激活,关闭,取消激活以及调度程序初始化的开始,它将编辑窗口设置为其选项。

function openCreateEditPopup(e){
            console.log('opening edit window', e);
            console.log($('#scheduler'));
            $('#scheduler')[0].style.width = '988px';

            e.sender.wrapper[0].style.paddingTop = '0px';
            e.sender.wrapper[0].style.left = '';
            e.sender.wrapper[0].style.right = '0px';
            console.log($('.k-overlay'));

            //scheduler.view(scheduler.view().name);

        }
function finishOpeningEditPopup(e){
            $('.k-overlay')[0].style.display = 'none';
            //scheduler.view(scheduler.view().name);
        }
        function closeCreateEditPopup(e){
            $('#scheduler')[0].style.width = '100%'; 
            //scheduler.view(scheduler.view().name);
        }
        function finishClosingEditPopup(e){
            //scheduler.view(scheduler.view().name);
        }
        function createScheduler(resources, setUp) {

            var AgendaDayView = kendo.ui.AgendaView.extend({
                endDate: function(){
                    var date = kendo.ui.AgendaView.fn.startDate.call(this);
                    //console.log('custom agenda date: ', date);
                    return date;
                },
                name: 'Day Agenda'
            });
            scheduler = $('#scheduler').kendoScheduler({
                pdf: {
                    fileName: 'Current Schedule View.pdf',
                    proxyTarget: '_blank'
                },
                date: new Date(),
                startTime: new Date(),
                showWorkHours: false,
                //timezone: "America/Chicago",
                editable: {
                    editRecurringMode: 'occurrence',
                    move: false,
                    resize: false,
                    template: $("#editor_template").html(),
                    window: {
                        title: 'Event',
                        width: 432,
                        open: openCreateEditPopup,
                        activate: finishOpeningEditPopup,
                        close: closeCreateEditPopup,
                        deactivate: finishClosingEditPopup
                    }
                },

0 个答案:

没有答案