tags:

views:

37

answers:

1

I am doing a little app with JQuery, using drag-n-drop for the interface. Basically, the user grabs events (JQuery objects) and drops them on a calendar.

I want to be able to prompt the user for time input when the event is dropped, but the "Drop" event is my last hook to do work on the event object that was just dropped. So I can have a dialog prompt up with time fields, but I don't know how to link the selected times to the event object that originated it.

Is there something out there that works like javascript Prompt() but allows for more sophisticated inputs?

This is an example of the interface: http://arshaw.com/js/fullcalendar/examples/external-dragging.html

Here is what the code looks like, and where the "Drop" event is defined:

 $('#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  A: 

You can use jquery UI dialog with Clock Pick or Time Entry plugin, or you can write your own time picker with look and feel of your app.

Update
I foud this jquery-alert-dialogs plugins.

jcubic
@jcubic - JQuery dialog works like prompt()? Maybe I was using it wrong, but it continued executing code while the dialog was up..
cinqoTimo
I doesn't work like prompt but you can implement similar functionality with it.
jcubic