开发者

How to select select without Javascript Title prompt?

select: function(start, end, allDay)开发者_开发问答 {
            var title = prompt('Event Title:');
            if (title) {
                calendar.fullCalendar('renderEvent',
                    {
                        title: title,
                        start: start,
                        end: end,
                        allDay: allDay
                    },
                    true // make the event "stick"
                );
            }
            calendar.fullCalendar('unselect');
        },

I can select a date(period) only if I enter a title.

How can I fix this so that I can enter an event without title?

Note: Fullcalendar from arshaw.com/fullcalendar/


I have this someone may find usefull for example y have a dialog with 2 inputs and a create button (html) i wanna input title and other info, took me a while to figure out uuuuf it wooooorks be thankfull for my genius hehe:)

        select: function(start, end, allDay) { 

            $('#mydialog').dialog('open'); // open the dialog you must have a div defined with 2 or more inputs


    $("#create").bind("click", { start: start, end: end,allDay: allDay }, function(event){ // when you click in a create button inside dialog you should send as parameters start,end,etc
        $input1 = $("#input1").val();
        $title = $("#input2").val();

            if ($title) {

                $mycalendar.fullCalendar('renderEvent',
                {
                    id: $id, //  CORREGIR obtener el ultimo id
                    title: $title,
                    start: start,
                    end: end,
                    allDay: allDay,
                    url: $url
                },
                true // make the event "stick"
                );


            }else{
                $mycalendar.fullCalendar('unselect');
            }


        $('#mydialog').dialog('close');// close my dialog

    });

        },


You could go for a html popup and a callback method to store the value instead of javascript prompt, that gives you much more controll over layout and more.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜