////////////////////
//标准方法接口定义
function SetData(data) {
if (data.action == "edit") {
//跨页面传递的数据对象,克隆后才可以安全使用
data = mini.clone(data);
$.ajax({
url: "../data/AjaxService.jsp?method=GetEmployee&id=" + data.id,
cache: false,
success: function (text) {
var o = mini.decode(text);
form.setData(o);
onDeptChanged();
mini.getbyName("position").setValue(o.position);
}
});
}
}
function GetData() {
var o = form.getData();
return o;
}
function CloseWindow(action) {
if (window.CloseOwnerWindow) window.CloseOwnerWindow(action);
else window.close();
}
function onOk(e) {
SaveData();
}
function onCancel(e) {
CloseWindow("cancel");
}
//////////////////////////////////
function onDeptChanged(e) {
var deptCombo = mini.getbyName("dept_id");
var positionCombo = mini.getbyName("position");
var dept_id = deptCombo.getValue();