PDA

View Full Version : msgTarget "side" doesn't work on Ext.form.TextField



JayOtt
1 Sep 2010, 9:30 AM
Hi guys,

I use Ext 3.2.1.

I was trying to convert an existing HTML text field to Ext.form.TextField. But the msgTarget: 'side' (or 'under') configuration didn't work. It always shows as 'normal' tooltip. But the default 'qtip' works though.

Here is my code:

script:
Ext.onReady(function(){
Ext.QuickTips.init();

new Ext.form.TextField({
allowBlank: false,
vtype: 'email',
msgTarget: 'side',
applyTo: 'tt_email'
});

...
...

HTML:

<body>
<form>
<label>Email: </label>
<input type="text" id="tt_email" name="textfield_email" width="200" />
...
...


Any ideas?

zachext
1 Sep 2010, 8:26 PM
Hi.

The 'side' and 'under' message targets need a container in which to render. If you were to define the TextField as an item of a FormPanel (or any Panel class with layout:'form'), the necessary container would be created as part of the rendering process.

In this case you could create that container in html and apply a specific class (x-form-field-wrap or x-form-element).

Here's an example:

<body>
<form>
<div class="x-form-field-wrap">
<label>Email: </label>
<input type="text" id="tt_email" name="textfield_email" width="200" />
</div>

JayOtt
2 Sep 2010, 6:53 AM
Thank you very much, zachext. It works.