Ext.Net保存前判断GridPanel中必填项是否为空

var ValidateBlank = function () {
var store = App.GP_Main.store;
for (i = 0; i < store.getCount(); i++) {
if (!store.getAt(i).data.Name || typeof (store.getAt(i).data.Type) == "undefined") {
X.Msg.show({ title: "操作提示", icon: X.MessageBox.ERROR, msg: "第" + (i + 1) + "行 必输项 不能为空!", buttons: X.Msg.OK });
return false;
}
}
};

调用

B_Save.Click.Before = "ValidateBlank";

猜你喜欢

转载自www.cnblogs.com/Anthony518/p/10897246.html