class type configs =Inheritsobject
..end
method id : Js.js_string Js.t Js.prop
The id of this controller. You can use this id when dispatching.
method models : 'a. 'a Js.t Js.prop
Array of models to require from AppName.model namespace. For example:
Ext.define("MyApp.controller.Foo", {
extend: "Ext.app.Controller",
models: ['User', 'Vehicle']
});
This is equivalent of:
Ext.define("MyApp.controller.Foo", {
extend: "Ext.app.Controller",
requires: ['MyApp.model.User', 'MyApp.model.Vehicle'],
getUserModel: function() {
return this.getModel("User");
},
getVehicleModel: function() {
return this.getModel("Vehicle");
}
});
method refs : 'b. 'b Js.t Js.js_array Js.t Js.prop
Array of configs to build up references to views on page. For example:
Ext.define("MyApp.controller.Foo", {
extend: "Ext.app.Controller",
refs: [{
ref: 'list',
selector: 'grid'
}],
});
This will add method getList
to the controller which will internally use
Ext.ComponentQuery to reference the grid component on page.
The following fields can be used in ref definition:
ref
- name of the reference.selector
- Ext.ComponentQuery selector to access the component.autoCreate
- True to create the component automatically if not found on page.forceCreate
- Forces the creation of the component every time reference is accessed
(when get<REFNAME>
is called).xtype
- Used to create component by its xtype with autoCreate or forceCreate. If
you don't provide xtype, an Ext.Component instance will be created.method stores : 'c. 'c Js.t Js.prop
Array of stores to require from AppName.store namespace and to generate getter methods for. For example:
Ext.define("MyApp.controller.Foo", {
extend: "Ext.app.Controller",
stores: ['Users', 'Vehicles']
});
This is equivalent to:
Ext.define("MyApp.controller.Foo", {
extend: "Ext.app.Controller",
requires: [
'MyApp.store.Users',
'MyApp.store.Vehicles'
]
getUsersStore: function() {
return this.getStore("Users");
},
getVehiclesStore: function() {
return this.getStore("Vehicles");
}
});
method views : 'd. 'd Js.t Js.prop
Array of views to require from AppName.view namespace and to generate getter methods for. For example:
Ext.define("MyApp.controller.Foo", {
extend: "Ext.app.Controller",
views: ['List', 'Detail']
});
This is equivalent of:
Ext.define("MyApp.controller.Foo", {
extend: "Ext.app.Controller",
requires: ['MyApp.view.List', 'MyApp.view.Detail'],
getListView: function() {
return this.getView("List");
},
getDetailView: function() {
return this.getView("Detail");
}
});
method init : 'e.
((< id : Js.js_string Js.t Js.prop; init : 'e. 'f;
listeners : 'h. 'h Js.t Js.prop; models : 'a. 'a Js.t Js.prop;
onLaunch : 'i.
('g Js.t, 'i Js.t -> unit) Js.meth_callback
Js.writeonly_prop;
refs : 'b. 'b Js.t Js.js_array Js.t Js.prop;
stores : 'c. 'c Js.t Js.prop; views : 'd. 'd Js.t Js.prop; .. >
as 'g)
Js.t, 'e Js.t -> unit)
Js.meth_callback Js.writeonly_prop as 'f
t.init
method onLaunch : 'i. ('g Js.t, 'i Js.t -> unit) Js.meth_callback Js.writeonly_prop
t.onLaunch