代码之家  ›  专栏  ›  技术社区  ›  tpow

使用jquery收集用户输入

  •  0
  • tpow  · 技术社区  · 14 年前

    我正在用jquery做一个小应用,在界面上使用drag-n-drop。基本上,用户获取事件(jquery对象)并将其放到日历上。

    我希望能够在事件被删除时提示用户输入时间,但是“drop”事件是我最后一个在刚刚删除的事件对象上执行工作的钩子。所以我可以让一个带有时间字段的对话框提示,但是我不知道如何将所选时间链接到发起它的事件对象。

    是否存在类似于javascript prompt()但允许更复杂输入的功能?

    以下是接口示例: http://arshaw.com/js/fullcalendar/examples/external-dragging.html

    下面是代码的外观以及定义“drop”事件的位置:

     $('#calendar').fullCalendar({
                    events: getSchedule(),
                    header: {
                        left: 'prev,next today',
                        center: 'title',
                        right: 'month,agendaWeek,agendaDay'
                    },
                    editable: true,
                    droppable: true,
                    drop: function(date, allDay) {
                     // this function is called when something is dropped
                     // Need to prompt for time, and attach it to the event that was dropped    
    
    });
    
    1 回复  |  直到 14 年前