最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Fullcalendar editable property not working? - Stack Overflow

programmeradmin3浏览0评论

Here is my code

 $(document).ready(function() {

    $('#calendar').fullCalendar({
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,basicWeek,basicDay'
        },
        dayClick: function() {
            alert('nemke');
        },        
        events: function(start, end, callback) {
            $.ajax({
                url: 'UserCalendarService.asmx/GetEvents',
                type: 'POST',
                dataType: 'xml',
                data: {start: + Math.round(start.getTime() / 1000),end: + Math.round(end.getTime() / 1000)},                
                success: function(result) {                
                var events = [];
                $(result).find('Event').each(function() {
                    events.push({
                        title: $(this).find('Title').text(),
                        start: $(this).find('Start').text(),
                        editable: $(this).find('Editable').text() 
                    });
                });
                callback(events);
                }
            });
        },
        disableResizing: true,
        editable: false
        //disableDragging:true
    })  
});

This property editable false is not working. I tried to set each event it's behavior from the server, and it didn't work. Then I tried to set the property to false, and it also didn't work. I need to set some events editable and some not. I can only set disableDragging, but that doesn't solve my issue 'cause I need some of the events to be able to drag.

This property only works with event source set as array like this example Looks like this ajax callback is not working. Has anyone had similar issue?

Fullcalendar link

Here is my code

 $(document).ready(function() {

    $('#calendar').fullCalendar({
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,basicWeek,basicDay'
        },
        dayClick: function() {
            alert('nemke');
        },        
        events: function(start, end, callback) {
            $.ajax({
                url: 'UserCalendarService.asmx/GetEvents',
                type: 'POST',
                dataType: 'xml',
                data: {start: + Math.round(start.getTime() / 1000),end: + Math.round(end.getTime() / 1000)},                
                success: function(result) {                
                var events = [];
                $(result).find('Event').each(function() {
                    events.push({
                        title: $(this).find('Title').text(),
                        start: $(this).find('Start').text(),
                        editable: $(this).find('Editable').text() 
                    });
                });
                callback(events);
                }
            });
        },
        disableResizing: true,
        editable: false
        //disableDragging:true
    })  
});

This property editable false is not working. I tried to set each event it's behavior from the server, and it didn't work. Then I tried to set the property to false, and it also didn't work. I need to set some events editable and some not. I can only set disableDragging, but that doesn't solve my issue 'cause I need some of the events to be able to drag.

This property only works with event source set as array like this example Looks like this ajax callback is not working. Has anyone had similar issue?

Fullcalendar link

Share Improve this question edited Apr 11, 2011 at 22:58 nemke asked Apr 11, 2011 at 15:18 nemkenemke 2,4683 gold badges37 silver badges57 bronze badges 2
  • Looks like there is a bug in code, I changed URL to json feed and now it works, but still this is an open issue remaining – nemke Commented Apr 12, 2011 at 11:58
  • Have you found this solution? – Sanjay Goswami Commented Mar 1, 2017 at 6:24
Add a ment  | 

1 Answer 1

Reset to default 6

the .text() method returns a string and editable is supposed to have a boolean value

发布评论

评论列表(0)

  1. 暂无评论