我有一个弹出窗口,应该在提交期间关闭。但它没有关闭,但数据正在添加到网格中。使用的脚本是
$(document).ready(function(){
$("#dialog-form").dialog({
autoOpen : false,
height : 400,
width : 700,
modal : true,
title: "Currency Details",
close : function() {
$(this).dialog("close");
}
});
});
这是我的 ajaxsubmit
function saveCurrencyAjax() {
var str = $("#enumCurrency").serialize();
$.ajax({
type : "POST",
url : "../currency/saveEnumCurrency.action",
data : str,
success : function(response) {
$('#dialog-form').dialog('close');
},
error : function(e) {
alert('Error: ' + e);
}
});
};
这是我的控制器
@RequestMapping( value="/currency/saveEnumCurrency.action", method=RequestMethod.POST)
public ModelAndView saveenumCurrency(@ModelAttribute EnumCurrency enumCurrency, Errors errors) throws Exception {
ModelAndView mvc = null;
try{
List<EnumCurrency> enumCurrencys = new ArrayList<EnumCurrency>();
enumCurrencys.add(enumCurrency);
List<EnumCurrency> enumCurrencysList = enumCurrencyService.create(enumCurrencys);
mvc = new ModelAndView("setup/enumCurrencyList");
} catch (Exception e) {
e.printStackTrace();
}
return mvc;
}
提前感谢,如果需要更多信息,请告诉我。