Browse Source

rawdemo combo

luoyifan 4 năm trước cách đây
mục cha
commit
3f6a9e4f2f
1 tập tin đã thay đổi với 16 bổ sung0 xóa
  1. 16 0
      src/controls/combo.js

+ 16 - 0
src/controls/combo.js

@@ -0,0 +1,16 @@
+export default function () {
+    /**
+     * 改变必填项之前加星号
+     */
+    const t1 = Ext.form.field.Text.prototype.initComponent
+    Ext.form.field.Text.override({
+        initComponent: function () {
+            if (this.allowBlank === false || this.validateBlank === true) {
+                this.beforeLabelTextTpl = [
+                    '<span style="color:red;font-weight:bold" data-qtip="必填选项">*</span>'
+                ];
+            }
+            t1.call(this)
+        }
+    });
+}