SHOW:
|
|
- or go back to the newest paste.
1 | Ext.Array.each(this.elements, function(element) { | |
2 | element.ajaxConfig = <element.currentAjaxConfig + defaultAjaxConfig>; | |
3 | //add to a "pendingElements" array | |
4 | }); | |
5 | ||
6 | start: function() { | |
7 | Ext.Array.each(pendingElements, function(element) { | |
8 | LoadManager.addTask(element); | |
9 | // You can put the "default config" here, as well... | |
10 | // Just patch element.ajaxConfig | |
11 | // You can EVEN save the old callback, if you thing there is one/it can do any good! | |
12 | var previousCallback = element.ajaxConfig.callback; | |
13 | element.ajaxConfig.callback = function() { | |
14 | // make this element remove himself | |
15 | LoadManager.removeTask(element); | |
16 | previousCallback(); | |
17 | } | |
18 | Ext.Ajax.request(element.ajaxConfig); | |
19 | }); | |
20 | } | |
21 | ||
22 | constructor: function() { | |
23 | Ext.Array.each(this.elements, function(element) { | |
24 | element.defaultAjaxConfig = { | |
25 | callback: function() { | |
26 | // make this element remove himself | |
27 | LoadManager.removeTask(element); | |
28 | } | |
29 | } | |
30 | }); | |
31 | }, |