ExtJS4: How to show validation error message next to textbox, combobox etc

前端 未结 6 796
旧巷少年郎
旧巷少年郎 2020-12-29 08:05

I need to implement validation messages that appear right next to invalid field. Any help would be appreciated.

6条回答
  •  情书的邮戳
    2020-12-29 08:53

    msgTarget: 'side' will Add an error icon to the right of the field, displaying the message in a popup on hover only.

    if you read the documentation carefully, one more option is there for msgTarget http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Text-cfg-msgTarget

    [element id] Add the error message directly to the innerHTML of the specified element. you have to add a "td" to the right side of the control dynamically with the id. then if you specify msgTarget: 'element id' it will work.

提交回复
热议问题