Browse Source

Pull request #2528: BI-95364 fix:form提供change事件

Merge in VISUAL/fineui from ~CLAIRE.TANG/fineui:master to master

* commit '2ff79c22c126497335d624e763d5f4f66bb04dd0':
  BI-95364 fix:form提供change事件
es6
Claire.Tang 3 years ago
parent
commit
500ced354d
  1. 10
      src/component/form/form.js
  2. 3
      typescript/component/form/form.ts

10
src/component/form/form.js

@ -51,12 +51,7 @@
listeners: [{ listeners: [{
eventName: "EVENT_CHANGE", eventName: "EVENT_CHANGE",
action: function () { action: function () {
this.validate(); self.fireEvent(BI.Form.EVENT_CHANGE, this.validate());
if (self.isAllValid()) {
self.fireEvent("EVENT_VALID");
} else {
self.fireEvent("EVENT_ERROR");
}
} }
}] }]
}; };
@ -94,6 +89,5 @@
} }
}); });
BI.Form.EVENT_VALID = "EVENT_VALID"; BI.Form.EVENT_CHANGE = "EVENT_CHANGE";
BI.Form.EVENT_ERROR = "EVENT_ERROR";
BI.shortcut("bi.custom_form", BI.Form); BI.shortcut("bi.custom_form", BI.Form);

3
typescript/component/form/form.ts

@ -2,8 +2,7 @@ import { Widget } from "../../core/widget";
export declare class Form extends Widget { export declare class Form extends Widget {
static xtype: string; static xtype: string;
static EVENT_VALID: string; static EVENT_CHANGE: string;
static EVENT_ERROR: string;
isAllValid(): boolean; isAllValid(): boolean;

Loading…
Cancel
Save