ExtJS 5 Textfield Chrome Bug Fix

By Vitaliy on July 03, 2015. ExtJS 5.0.0
3308
This bug can be fixed by single css line: .x-form-text { display: inline; }

Js Code

Ext.onReady(function () {
    Ext.widget({
        title: 'Form',
        xtype: 'form',
        width: 400,
        frame: true,
        bodyPadding: 10,
        items: [{
            fieldLabel: 'Bug field',
            xtype: 'textfield'
        }, {
            fieldLabel: 'Fixed field',
            xtype: 'textfield',
            fieldCls: 'fixed'
        }],
        renderTo: 'output'
    });
});    

ExtJS 4 Custom VType

By Vitaliy on February 11, 2013. ExtJS 4.1.1
3166
​You should add your validation method to Ext.form.field.VTypes.
Also add "<yourvtype>Text" (e.g. uniquenameText) property to show as error message.

Js Code

Ext.apply(Ext.form.field.VTypes, {
    uniquename: function (v) {
        return Ext.form.field.VTypes.uniquenameRegex.test(v);
    },
    uniquenameRegex: /^[a-z]{1}[a-z_0-9]*$/,
    uniquenameText: 'Invalid unique name'
});    

How to add button to each form field?

By Vitaliy on August 15, 2012. ExtJS 4.1.0
2953
Reply to thread

Js Code

var fieldcontainer = Ext.widget({
	xtype: 'fieldcontainer',
	layout: 'hbox'
});

var field = Ext.widget(item);

fieldcontainer.add(field);
fieldcontainer.add(Ext.widget({
	xtype: 'splitter'
}));
var clearer = Ext.widget({
	xtype: 'button',
	field: field,
	disabled: field.disabled,
	handler: function () { this.field.reset(); }
});
fieldcontainer.add(clearer);