Question

I am trying to extend the TextField to initialize the value based on the location information. The following code does what i need.

Ext.define("Tasks.view.LatitudeField", {
    extend: 'Ext.field.Text',
    alias:'widget.latitudeField',

    xtype: 'latitudefield',  

    initialize : function() 
    {
        console.log("Component Initialized ");
        this.setValue("123456");
    },
});

But when the field is displayed, I can't click on the x icon to clear the text. The x icon is not clickable at all.

enter image description here

Was it helpful?

Solution

Call the parent method in your initialize method:

initialize: function() {
    console.log("Component Initialized ");
    this.setValue("123456");

    this.callParent(arguments);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top