Rails Fullcalendar modal close gets uncaught error -
i have rails app using fullcalendar. has modal entering labor hours. modal shows fine , if enter data, gets added database.
but, modal won't close. cancel button , x in top right corner of modal don't work.
i uncaught jquery.event.remove in browser console. see attached pic.
i have similar code working in application. i've looked , looked differences cause - no avail.
the statement not working $(this).dialog "close". but, said, statement works fine in application using fullcalendar.
i'm not sure look.
how chase down uncaught error? (i feel other javascript (not fullcalendar) that's causing error.)
here coffeescript buttons created:
$("#dialog-form").dialog autoopen: true height: 450 width: 400 modal: true buttons: "create labor": -> $.create "/events/", event: workorder_id: workorder.val(), actcode_id: actcode.val(), title: title.val(), description: description.val(), hours: hours.val(), starts_at: "" + start, ends_at: "" + end, all_day: allday, maxsynch: "n", employee_id: $('#calendar').data('employeeid'), overtime: "true" if $("#overtime").is(":checked") complete: -> $('#calendar').fullcalendar('refetchevents') $(this).dialog "close" $('#calendar').fullcalendar('refetchevents') $("#workorder_id").val("") $("#title").val("") $("#hours").val("") $("#description").val("") cancel: -> $(this).dialog "close" this screenshot:
help!
udpate
with dialog displaying, typed following browser console:
$(this).dialog("close") and got message:
error: cannot call methods on dialog prior initialization; attempted call method 'close' and following did nothing:
$("#dialog-form").dialog("close") update2
this worked close modal:
$('.ui-dialog').remove() but, page left grey , not working.
the this in $(this).dialog "close" not pointing modal, button.
what change line to:
$('#modalid').dialog "close" (replace modalid id have)
Comments
Post a Comment