| api : ObjectSpecific urls to call on CRUD action methods "read", "create", "update" and "destroy".
+}),
+ And new in Ext version 3, attach centralized event-listeners upon the DataProxy class itself! This is a great place
+to implement a messaging system to centralize your application's user-feedback and error-handling.
+ // Listen to all "beforewrite" event fired by all proxies.
+Ext.data.DataProxy.on('beforewrite', function(proxy, action) {
+ console.log('beforewrite: ', action);
+});
+
+// Listen to "write" event fired by all proxies
+Ext.data.DataProxy.on('write', function(proxy, action, data, res, rs) {
+ console.info('write: ', action);
+});
+
+// Listen to "exception" event fired by all proxies
+Ext.data.DataProxy.on('exception', function(proxy, type, action) {
+ console.error(type + action + ' exception);
+});
+ Note: These three events are all fired with the signature of the corresponding DataProxy instance event beforewrite, write and exception. Config Options|
| api : ObjectSpecific urls to call on CRUD action methods "read", "create", "update" and "destroy".
Defaults to:api: {
read ... Specific urls to call on CRUD action methods "read", "create", "update" and "destroy".
Defaults to: api: {
@@ -84,9 +101,9 @@ myStore.on({
}
}
});
- | DataProxy | | doRequest : Function Abstract method that should be implemented in all subclasses
+ | DataProxy | | doRequest : FunctionAbstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers.
... | DataProxy | | listeners : Object | DataProxy | | listeners : ObjectA 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.
@@ -141,7 +158,7 @@ Ext.DomObserver = Ext.extend(Object, {
typeAhead: true,
mode: 'local',
triggerAction: 'all'
-}); | Observable | | restful : BooleanDefaults to false. Set to true to operate in a RESTful manner.
+}); | Observable | | onRead : FunctionAbstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. ... Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. Callback for read action. | DataProxy | | onWrite : FunctionAbstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. ... Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. Callback for create, update and destroy actions. | DataProxy | | restful : BooleanDefaults to false. Set to true to operate in a RESTful manner.
Note: this parameter will automatically be set to t... Defaults to false. Set to true to operate in a RESTful manner.
Note: this parameter will automatically be set to true if the
Ext.data.Store it is plugged into is set to restful: true . If the
@@ -229,7 +246,7 @@ Or a shorthand syntax:
scope: this
}); Returns: | Observable | | destroy()
:
- voidDestroys the proxy by purging any event listeners and cancelling any active requests. Destroys the proxy by purging any event listeners and cancelling any active requests. | DataProxy | | enableBubble( Object events )
+ voidDestroys the proxy by purging any event listeners and cancelling any active requests. Destroys the proxy by purging any event listeners and cancelling any active requests. | DataProxy | | 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
@@ -238,13 +255,13 @@ this.getBubbleTarget() if present... Enables events fi
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: Ext.override(Ext.form.Field, {
-// Add functionality to Field's initComponent to enable the change event to bubble
- initComponent: Ext.form.Field.prototype.initComponent.createSequence(function() {
- this.enableBubble('change');
+ // Add functionality to Field's initComponent to enable the change event to bubble
+ initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {
+ this.enableBubble('change');
}),
-// We know that we want Field's events to bubble directly to the FormPanel.
- getBubbleTarget: function() {
+ // We know that we want Field's events to bubble directly to the FormPanel.
+ getBubbleTarget : function() {
if (!this.formPanel) {
this.formPanel = this.findParentByType('form');
}
@@ -259,11 +276,11 @@ access the required target more quickly.
}],
listeners: {
change: function() {
-// Title goes red if form has been modified.
- myForm.header.setStyle("color", "red");
+ // Title goes red if form has been modified.
+ myForm.header.setStyle('color', 'red');
}
}
-});
| Observable | | fireEvent( String eventName , Object... args )
+}); | 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).
@@ -289,7 +306,7 @@ the corresponding code for CRUD action. Param
:
voidRemoves an event handler. Removes an event handler. | Observable | | request( String action , Ext.data.Record/Ext.data.Record[]/null rs , Object params , Ext.data.DataReader reader , Function callback , Object scope , Object options )
:
- voidAll proxy actions are executed through this method. Automatically fires the "before" + action event All proxy actions are executed through this method. Automatically fires the "before" + action event | DataProxy | | resumeEvents()
+ voidAll proxy actions are executed through this method. Automatically fires the "before" + action event All proxy actions are executed through this method. Automatically fires the "before" + action event | DataProxy | | resumeEvents()
:
voidResume firing events. (see suspendEvents)
If events were suspended using the queueSuspended parameter, then all
|
|