when text field contain listeners config, label return back to field with content, but it wrong
when text field contain listeners config, label return back to field with content, but it wrong
Look at label in material theme:
{
xtype: 'textfield',
fieldLabel: 'Some field',
value: 'type text',
listeners : {
}
}
See https://fiddle.sencha.com/#view/editor&fiddle/3248 with your problem
You can justto embed your fiddle here.Code:[FIDDLE ]3248[/FIDDLE]
Object.NET
Frameworks and Tools for .NET Developers
--------------------------------------------------
Ext.NET - Ext JS for ASP.NET - Examples | Twitter
Bridge.NET - Write C#. Run JavaScript! - Live | Twitter
--------------------------------------------------
No, but a workaround.You can add a listener to textfield or combobox in the init code of the view controller.This prevent this strange behaviorCode:init: function (view) { var combo = view.down("#yourComboBox"); // works also for textfield combo.addListener({ change: function (combobox, newValue, oldValue, eOpts) { // your code } }); }
That's awesome there is a workaround for such a basic and core piece of the new 7.0 major release.
Hi, the problem is here :
When you override the listeners config, change & render events are not fired, and the 'not-empty' cls is not added to fieldPHP Code:
Ext.define('Ext.theme.material.form.field.Text', {
override: 'Ext.form.field.Text',
labelSeparator: '',
listeners: {
change: function(field, value) {
if (field.el) {
field.el.toggleCls('not-empty', value || field.emptyText);
}
},
render: function(ths, width, height, eOpts) {
if ((ths.getValue() || ths.emptyText) && ths.el) {
ths.el.addCls('not-empty');
}
}
}
});
Maybe something like :
would workPHP Code:
Ext.define('Ext.theme.material.form.field.Text', {
override : 'Ext.form.field.Text',
labelSeparator : '',
listeners:{},
initComponent : function () {
this.callParent();
this.on({
change : function (field, value) {
if (field.el) {
field.el.toggleCls('not-empty', value || field.emptyText);
}
},
render : function (ths, width, height, eOpts) {
if ((ths.getValue() || ths.emptyText) && ths.el) {
ths.el.addCls('not-empty');
}
},
scope : this
});
}
});