class type t =Inheritsobject
..end
method initComponent : unit Js.meth
The initComponent template method is an important initialization step for a Component. It is intended to be implemented by each subclass of Ext.Component to provide any needed constructor logic. The initComponent method of the class being created is called first, with each initComponent method up the hierarchy to Ext.Component being called thereafter. This makes it easy to implement and, if needed, override the constructor logic of the Component at any step in the hierarchy.
The initComponent method must contain a call to callParent in order to ensure that the parent class' initComponent method is also called.
All config options passed to the constructor are applied to this
before initComponent is called,
so you can simply access them with this.someOption
.
The following example demonstrates using a dynamic string for the text of a button at the time of instantiation of the class.
Ext.define('DynamicButtonText', {
extend: 'Ext.button.Button',
initComponent: function() {
this.text = new Date();
this.renderTo = Ext.getBody();
this.callParent();
}
});
Ext.onReady(function() {
Ext.create('DynamicButtonText');
});
method showAt_arr : Js.number Js.t Js.js_array Js.t -> unit Js.meth
Shows this tip at the specified XY position. Example usage:
// Show the tip at x:50 and y:100
tip.showAt([50,100]);
Parameters:
Js.number Js.t Js.js_array Js.t
An array containing the x and y coordinates