标签:
通过查看easyui的帮助文档,dialog继承于window,window继承于panel,panel中有个onLoad事件,也就是当远程数据加载完成后,触发此事件。因此只要在此事件中对对话框中的内容进行初始化就可以了。
var $addEvent = $("#addEvent");
// 初始化对话框
$addEvent.dialog({
title: '新增待办工作',
width: 400,
height: 250,
closed: false,
cache: false,
href: "page/AddEvent.html",
buttons: [{
text: ' 确认 ',
handler: function () {
$title = $("#title");
alert($("#datebox").datebox("getValue"));
// 在日历中增加事件
calendar.fullCalendar('renderEvent',
{
title: $title.val(),
start: start,
end: end,
allDay: allDay
},
true // make the event "stick"
);
calendar.fullCalendar('unselect');
$addEvent.window("close");
}
},
{
text: ' 取消 ',
handler: function () {
$addEvent.window("close");
}
}
],
onLoad: function () {
$("#datebox").datebox("setValue", "2012-01-01");
}
});easyui dialog远程加载内容完成后,进行对话内容(表单)初始化
标签:
原文地址:http://blog.csdn.net/handsometone1982/article/details/43852903