Observable Controller
Package: | Ext |
Defined In: | Controller.js |
Class: | Controller |
Extends: | Observable |
Config Options | Defined By | |
---|---|---|
listeners : Object A config object containing one or more event handlers to be added to this
object during initialization. This should ... A config object containing one or more event handlers to be added to this object during initialization. This should be a valid listeners config object as specified in the addListener example for attaching multiple handlers at once. DOM events from ExtJs Components While some ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this
is usually only done when extra value can be added. For example the DataView's
| Observable |
Property | Defined By | |
---|---|---|
renderTarget : Ext.Container The current {@link #setRenderTarget render target}. Read only | Controller |
Method | Defined By | |
---|---|---|
Controller()
Parameters:
| Controller | |
addEvents( Object|String o , string Optional. )
:
voidAdds the specified events to the list of events which this Observable may fire. Adds the specified events to the list of events which this Observable may fire. Parameters:
| Observable | |
addListener( String eventName , Function handler , [Object scope ], [Object options ] )
:
voidAppends an event handler to this object. Appends an event handler to this object. Parameters:
| Observable | |
addManagedListener( Observable|Element item , Object|String ename , Function fn , Object scope , Object opt )
:
voidAdds listeners to any Observable object (or Element) which are automatically removed when this Component
is destroyed... Adds listeners to any Observable object (or Element) which are automatically removed when this Component is destroyed. Parameters:
| Observable | |
build()
:
void Callback automatically tied to the index view's 'build' event. By default this just renders the registered
'build' vi... Callback automatically tied to the index view's 'build' event. By default this just renders the registered
'build' view Parameters:
| Controller | |
clearListeners()
:
void Removes all listeners for this object including the managed listeners Removes all listeners for this object including the managed listeners Parameters:
| Observable | |
clearManagedListeners()
:
void Removes all managed listeners for this object. Removes all managed listeners for this object. Parameters:
| Observable | |
control()
:
void This function allows you to add listeners to a view
in a convenient way This function allows you to add listeners to a view
in a convenient way Parameters:
| Controller | |
create( Object data , Object options )
:
voidSaves a phantom Model instance via its configured Proxy. Fires the 'instance-created' event if successful,
the 'insta... Saves a phantom Model instance via its configured Proxy. Fires the 'instance-created' event if successful,
the 'instance-creation-failed' event if not. Parameters:
| Controller | |
destroy( Ext.data.Model instance , Object options )
:
voidDestroys one or more existing, previously saved model instances Destroys one or more existing, previously saved model instances Parameters:
| Controller | |
edit( Ext.data.Model instance )
:
voidRenders the edit form for a given model instance Renders the edit form for a given model instance Parameters:
| Controller | |
enableBubble( String/Array events )
:
voidEnables events fired by this Observable to bubble up an owner hierarchy by calling
this.getBubbleTarget() if present.... Enables events fired by this Observable to bubble up an owner hierarchy by calling
This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly. Example:
Parameters:
| Observable | |
fireEvent( String eventName , Object... args )
:
BooleanFires the specified event with the passed parameters (minus the event name).
An event may be set to bubble up an Obse... Fires the specified event with the passed parameters (minus the event name). An event may be set to bubble up an Observable parent hierarchy (See Ext.Component.getBubbleTarget) by calling enableBubble. Parameters:
| Observable | |
getBuildListeners()
:
Object Returns the listeners to attach to the view rendered by the build action. By default this returns listeners
for save ... Returns the listeners to attach to the view rendered by the build action. By default this returns listeners
for save and cancel, but this can be overridden Parameters:
| Controller | |
getEditListeners()
:
Object Returns the listeners to attach to the view rendered by the edit action. By default this returns listeners
for save a... Returns the listeners to attach to the view rendered by the edit action. By default this returns listeners
for save and cancel, but this can be overridden Parameters:
| Controller | |
getModel()
:
Ext.data.Model Returns the constructor for the model type linked to this controller Returns the constructor for the model type linked to this controller Parameters:
| Controller | |
hasListener( String eventName )
:
BooleanChecks to see if this object has any listeners for a specified event Checks to see if this object has any listeners for a specified event Parameters:
| Observable | |
on( String eventName , Function handler , [Object scope ], [Object options ] )
:
voidAppends an event handler to this object (shorthand for addListener.) Appends an event handler to this object (shorthand for addListener.) Parameters:
| Observable | |
onCancelBuild( Ext.Component view )
:
voidHandler for the 'cancel' event fired by an build view. By default this just closes the view Handler for the 'cancel' event fired by an build view. By default this just closes the view Parameters:
| Controller | |
onCancelEdit( Ext.Component view )
:
voidHandler for the 'cancel' event fired by an edit view. By default this just closes the view Handler for the 'cancel' event fired by an edit view. By default this just closes the view Parameters:
| Controller | |
onCreateInstance( Ext.View view )
:
voidCallback automatically tied to the index view's 'create' event. By default this just calls the controller's
create fu... Callback automatically tied to the index view's 'create' event. By default this just calls the controller's
create function with the data and some basic callbacks to handle errors or show success. Can be overridden
to provide custom behavior Parameters:
| Controller | |
onDestroyInstance( Ext.data.Model instance , Ext.View view )
:
voidCallback automatically tied to the index view's 'destroy' event. By default that just calls the controller's
destroy ... Callback automatically tied to the index view's 'destroy' event. By default that just calls the controller's
destroy function with the model instance and some basic callbacks to handle errors or show success. Can be
overridden to provide custom behavior. Parameters:
| Controller | |
onUpdateInstance( Ext.Component view )
:
voidCallback automatically tied to the index view's 'update' event. By default this just calls the controller's
update fu... Callback automatically tied to the index view's 'update' event. By default this just calls the controller's
update function with the data and some basic callbacks to handle errors or show success. Can be overridden
to provide custom behavior Parameters:
| Controller | |
relayEvents( Object o , Array events )
:
voidRelays selected events from the specified Observable as if the events were fired by this. Relays selected events from the specified Observable as if the events were fired by this. Parameters:
| Observable | |
removeListener( String eventName , Function handler , [Object scope ] )
:
voidRemoves an event handler. Removes an event handler. Parameters:
| Observable | |
removeManagedListener( Observable|Element item , Object|String ename , Function fn , Object scope )
:
voidRemoves listeners that were added by the mon method. Removes listeners that were added by the mon method. Parameters:
| Observable | |
render( String viewName , Object config )
:
Ext.ViewRenders a given view based on a registered name Renders a given view based on a registered name Parameters:
| Controller | |
resumeEvents()
:
void Resume firing events. (see suspendEvents)
If events were suspended using the queueSuspended parameter, then all
event... Resume firing events. (see suspendEvents)
If events were suspended using the queueSuspended parameter, then all
events fired during event suspension will be sent to any listeners now. Parameters:
| Observable | |
setRenderTarget( Ext.Container target )
:
voidSets the default container that components rendered using render will be added to.
In many applications there is a fi... Sets the default container that components rendered using render will be added to.
In many applications there is a fixed navigation panel and a content panel - the content
panel would usually form the render target in this type of setup. Parameters:
| Controller | |
suspendEvents( Boolean queueSuspended )
:
voidSuspend the firing of all events. (see resumeEvents) Suspend the firing of all events. (see resumeEvents) Parameters:
| Observable | |
un( String eventName , Function handler , [Object scope ] )
:
voidRemoves an event handler (shorthand for removeListener.) Removes an event handler (shorthand for removeListener.) Parameters:
| Observable | |
update( Ext.data.Model instance , Object updates , Object options )
:
voidUpdates an existing model instance by applying optional updates to it and attempting to save Updates an existing model instance by applying optional updates to it and attempting to save Parameters:
| Controller |
Event | Defined By | |
---|---|---|
instance-created :
( Ext.data.Model instance )
Fired when a new model instance has been successfully created by this controller Fired when a new model instance has been successfully created by this controller Listeners will be called with the following arguments:
| Controller | |
instance-creation-failed :
( Ext.data.Model instance , Object errors )
Fired when an attempt at saving a new instance failed Fired when an attempt at saving a new instance failed Listeners will be called with the following arguments:
| Controller | |
instance-destroyed :
( Ext.data.Model instance )
Fired when an existing instance has been successfully destroyed by this controller Fired when an existing instance has been successfully destroyed by this controller Listeners will be called with the following arguments:
| Controller | |
instance-destruction-failed :
( Ext.data.Model instance , Object errors )
Fired when an existing instance could not be destroyed Fired when an existing instance could not be destroyed Listeners will be called with the following arguments:
| Controller | |
instance-update-failed :
( Ext.data.Model instance , Object errors )
Fired when an update to existing model instance could not be successfully completed Fired when an update to existing model instance could not be successfully completed Listeners will be called with the following arguments:
| Controller | |
instance-updated :
( Ext.data.Model instance )
Fired when an existing model instance has been successfully updated by this controller Fired when an existing model instance has been successfully updated by this controller Listeners will be called with the following arguments:
| Controller |