easyui项目开发记录
1.经典修改:
//修改配置
function editRow(obj, id, status) {
var p = $('<div/>').dialog({
title: '修改信息',
href: '${pageContext.request.contextPath}/views/loms/programguide_mdf_input.jsp',
top: 200,
width: 350,
iconCls: 'icon-edit',
modal: true,
buttons: [{
id: 'ok',
text: '确定',
iconCls: 'icon-ok',
plain: 'true',
handler: function() {
//确认框
if (checkParam()) {//参数校验
$('#ok').linkbutton('disable');
p.find('form').form('submit', {
url: '${pageContext.request.contextPath}/mdfProgramGuide',
success: function(data) {
var jsonObj = $.parseJSON(data);
if (jsonObj.retCode!='0') {
$.messager.show({title: '提示', msg: jsonObj.retMsg, timeout:5000});
return;
}
p.dialog('close');
$("#list_data").datagrid('reload');
$("#list_data").datagrid('clearSelections');
}
});
}
}
},
{id: 'cancel', text: '取消', iconCls: 'icon-cancel', plain: 'true', handler: function() {p.dialog('close');}}],
onClose: function() {$(this).dialog('destroy');},
onLoad: function() {
$.ajax({
url: "${pageContext.request.contextPath}/getProgramGuideDtl",
type: "get",
dataType: "json",
data: {"id": id},
success: function (data) {
if (data.retCode !== "0") {
$.messager.show({title: '提示', msg: data.retMsg, timeout:5000});
p.dialog('close');
$("#list_data").datagrid('reload');
return;
}
p.find('form').form('load',{
'id':id,
'programNameMdf':data.dtl.programName,
'timeFrom':data.dtl.startTime ? data.dtl.startTime.split(" ")[1] : "00:00:00",
'timeTo':data.dtl.endTime ? data.dtl.endTime.split(" ")[1] : "00:00:00",
});
var noMdfAuth = notInArray(btnAuthArr, '0') && notInArray(btnAuthArr, '2');
if (noMdfAuth) {
$("#programNameMdf").validatebox('options').required = false;
$("#programNameMdf").attr("readonly", "readonly");
$("#timeFrom").timespinner('options').required = false;
$("#timeFrom").attr("readonly", "readonly");
}
}
});
}
});
}
浙公网安备 33010602011771号