PDA

View Full Version : [CLOSED] Problem in textfield when has indicator and validator



supera
Oct 09, 2013, 8:18 PM

Baidaly
Oct 09, 2013, 10:12 PM
Hello!

You should use clearIndicator method:


txtCPF.clearIndicator();

supera
Oct 10, 2013, 11:18 AM

Daniil
Oct 10, 2013, 2:11 PM
Hi,

There is the showIndicator method for that.

The Indicator stuff appeared in Ext.NET, not in ExtJS. You could look at the sources.

trunk\Ext.Net\Build\Ext.Net\extnet\src\form\BaseFi eld.js

Sorry, no docs for that, but there is an example:
http://examples2.ext.net/#/Form/Field_Indicator/Overview/

There is the "Show/Hide" button as well.

supera
Oct 10, 2013, 2:49 PM

Daniil
Oct 10, 2013, 2:57 PM
Please try with the hideIndicator method instead of the clearIndicator one.

supera
Oct 10, 2013, 3:35 PM

Daniil
Oct 10, 2013, 4:16 PM
Sorry, I overlooked it. I will review tomorrow in details. If @Baidaly doesn't outrun me:)

Baidaly
Oct 10, 2013, 9:01 PM
When you clear indicator, it clears text, tip and other parameters of indicator.

To save indicator parameters you should use saveIndicator method. which saves it by default to the _indicators.default object of the TextField so you can have as many indicator config as you wish. You can use the saved value when you want to show the indicator.



var btn = mainContainer.add({
itemId: 'btn',
xtype: 'button',
x: 10,
y: 20,
width: 150,
text: 'clear Indicator',
listeners: {
click: {
fn: function (item) {
var me = this;
txtCPF.saveIndicator();
txtCPF.clearIndicator();
}
}
}
});

var btn = mainContainer.add({
itemId: 'btn',
xtype: 'button',
x: 10,
y: 80,
width: 150,
text: 'show Indicator',
listeners: {
click: {
fn: function (item) {
var me = this;
txtCPF.showIndicator(txtCPF._indicators.default);
}
}
}
});

supera
Oct 16, 2013, 11:48 AM

Daniil
Oct 16, 2013, 12:27 PM
Yes, it might work. Here is the saveIndicator method.

saveIndicator : function (name, ignoreExists) {
this._indicators = this._indicators || {};

if (ignoreExists && this._indicators[name || "default"]) {
return;
}

var holder = this._indicators[name || "default"] || {};
holder.indicatorText = this.indicatorText;
holder.indicatorCls = this.indicatorCls;
holder.indicatorIconCls = this.indicatorIconCls;
holder.indicatorTip = this.indicatorTip;

this._indicators[name || "default"] = holder;
}

supera
Nov 05, 2013, 11:13 AM
Works!
Thanks Daniil!