zoukankan      html  css  js  c++  java
  • 必填项的label后面加星号

    必填项的label后面加星号

    Ext.form.TextField.override({  

                    initComponent: Ext.form.TextField.prototype.initComponent.createInterceptor(function(){  

                        if (this.allowBlank === false && this.fieldLabel) {  

                            this.fieldLabel += '<font color=red>*</font>';  

                        }  

                    })  

                });  

    所有的输入项如果配置了allowBlack 为false,它的label后面就都会有红星号了,方便日后统一修改。

    这段代码加在appbase.js的最后,label里不需要再写 <font color=\'red\'>*</font>
  • 相关阅读:

    入门动态规划问题
    AC自动机
    KMP算法
    [OpenGL]用鼠标拖拽图形移动
    HDU-2222 Keywords Search
    Trie
    Manacher算法
    linux环境搭建
    Android Studio使用JNI和NDK进行开发
  • 原文地址:https://www.cnblogs.com/meetrice/p/2006573.html
Copyright © 2011-2022 走看看