简体   繁体   English

将指示符添加到必填表格字段

[英]Add indicator to required form field

in ExtJs 4.0.2 for requred field indication, i'm using this code: 在ExtJs 4.0.2中用于必填字段指示,我正在使用以下代码:

Ext.override(Ext.layout.Layout, {
  renderItem: function(item, target, position) {
  if (item && item.isFieldLabelable && !item.rendered && item.fieldLabel &&   item.allowBlank == false) {
     item.fieldLabel += ' <span class="req" style="color:red">*</span>';
   }
  this.callOverridden(arguments);
 }
 });

But in ExtJs 4.1 this code, don't work. 但是在ExtJs 4.1中,此代码不起作用。 What is changed? 有什么变化? Thank you! 谢谢!

在4.1.x中签出新标签标记更改http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Text-cfg-afterLabelTextTpl您不需要覆盖不再。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM