从添加到click事件的函数中获取值
|
这是准备好文档中的代码
$(document).ready(function {
$(\'button[id$=\"btnSave\"]\').click(function() {
saveEvent();
});
function saveEvent() {
$.colorbox.close();
result = { date: $(\'#txtDate\').val(), description: $(\'#txtDescription\').val() }
return result;
}
});
这是我需要此结果的地方
var calendar = $(\'#calendar\').fullCalendar({
editable: true,
disableResizing: true,
loading: function(bool) {
if (bool) {
$(\'#loading\').show();
}
else {
$(\'#loading\').hide();
}
},
dayClick: function(date, allDay, jsEvent, view) {
displayInput($(this), date);// show modal
//!!return results from modal on mouse click!!
},
events: {
url: \'UserCalendarService.asmx/GetEvents\',
type: \'POST\',
dataType: \'json\',
contentType: \"application/json; charset=utf-8\"
}
});
这可以正常工作,但是当我单击“保存”按钮时如何在其他函数中获取此结果对象。例如,当显示Colorbox模态时,用户单击保存按钮。那时如何获取saveEvent函数的返回值?
稍后,我需要回调以将此用户值放入日历ui中
没有找到相关结果
已邀请:
1 个回复
拭十年