dorado7.x重复新增的时候addForm中会携带上一次填写数据(这种情况产生的情形是只设置了dataType,未设置dataset),目前的处理办法是点击新增按钮的时候onclick事件中将新增的form中各个字段属性置为初始值。此时addForm属性中dataset不能设置,并且设置createPrivateDataSet为true,否则会取不到addForm.entity。
同时要将updateAction中的updateItem删除掉,因为此处也设置了dataset,我们此处没有采用dataset提交数据,会报错:没有数据可以提交!
需要进一步确认,是否设置了dataSet,即不会携带上一次提交的addForm数据。
view.get("#addDialog").show();
var formentity = view.get("#addForm.entity");
if(!isEmpty(formentity)){
formentity.set("id",null);
formentity.set("platformCode","-1");
formentity.set("operatorUser",null);
formentity.set("operatorTime",null);
}else{
dorado.MessageBox.alert("您没有新增页面权限,请检查页面控件权限配置!", {
icon: "WARNING"
});
return;
}
function isEmpty(obj){
if(typeof obj == "undefined" || obj == null || obj == ""){
return true;
}else{
return false;
}
}