Forms are set up by default with a very bland error display which shows any type of error with a squiggly red line under the form field. This error display closely mimics the errors shown in programs like Microsoft Word when you spell a word incorrectly. We do have other options for displaying our error messages, but we will need to tell Ext JS to use it.
The preferred option is to display the error message in a balloon. This utilizes the standard squiggly line, but also adds a balloon message that pops up when you mouse over the field.
|
|
We just need to add a line of code before our form is created that will initialize the balloon messages. Typically this is the first line within the OnReady
function.
For example:
Ext.onReady(function(){ Ext.QuickTips.init(); // our form here });
This is all that needs to happen for your form fields to start displaying error messages in a fancy balloon.