PDA

View Full Version : [CLOSED]Field Error message display popup problem


ktoole
03-05-2010, 08:52 AM
I have Ext.form.Field.prototype.msgTarget = 'under'; specified at the top of my program. This makes error messages display under the field when set back with this code:

var errorStore = new Ext.data.JsonStore({
root : 'ERRORS',
fields : ['FIELD','ERRORMSG'],
listeners : {
load: function(){
this.each(function(rec){
Ext.getCmp(rec.data.FIELD).markInvalid(rec.data.ER RORMSG);
})
}
}
})

This works great, except that the size of the form panel window changes when the errors are display and the bottom buttons can move off the visible screen. I tried to use Ext.form.Field.prototype.msgTarget = 'side';, but it will not display the error text when you hover over the field or the error icon. It does display that there is an error on the field, but no error text. Is there some way to get the error text to appear when hovering on the field or on the error icon with the markInvalid function? I guess I could also move the cancel and save buttons to the tbar, but I am thinking of a future program that might have lots of fields that could have errors and there might be enough error text to run off the screen.

ktoole
03-05-2010, 08:59 AM
I found the solution right after I posted this question. You need to use Ext.QuickTips.init(); at the start of the script to initialize stuff so that the form's validation errors can appear as tool tips. The following link is where I got the information on how to do this:

http://www.packtpub.com/article/load-validate-submit-forms-ext-js-3.0-part2?utm_source=js_ext_js_cook_abr1_1009&utm_medium=content&utm_campaign=janice