source:
trunk/workshop-routing-foss4g/web/GeoExt/lib/overrides/override-ext-ajax.jst
@
80
Revision 76, 1.9 KB checked in by djay, 13 years ago (diff) | |
---|---|
|
Line | |
---|---|
1 | .. _overrides.ext.ajax: |
2 | |
3 | Ext.Ajax Overrides |
4 | ================== |
5 | |
6 | GeoExt provides an override for the functionality in |
7 | `Ext.Ajax <http://dev.sencha.com/deploy/dev/docs/?class=Ext.Ajax>`_. If you include |
8 | the :file:`override-ext-ajax.js` file in your build, any calls to ``Ext.Ajax`` |
9 | methods will be routed through ``OpenLayers.Request`` methods. The practical |
10 | implication of this is that you can set the ``OpenLayers.ProxyHost`` property |
11 | in your application and have this proxy used by Ext components that call |
12 | ``Ext.Ajax`` methods. |
13 | |
14 | To include :file:`override-ext-ajax.js` in your build, the GeoExt section in |
15 | your build config should look like one of the following: |
16 | |
17 | .. code-block:: ini |
18 | |
19 | # include everything (including override-ext-ajax.js) |
20 | [GeoExt.js] |
21 | root = ../lib |
22 | license = geoext-license.js |
23 | exclude = |
24 | GeoExt.js |
25 | GeoExt/SingleFile.js |
26 | |
27 | |
28 | or |
29 | |
30 | .. code-block:: ini |
31 | |
32 | # custom build |
33 | [GeoExt.js] |
34 | root = ../lib |
35 | license = geoext-license.js |
36 | include = |
37 | overrides/override-ext-ajax.js |
38 | # other files listed here ... |
39 | |
40 | |
41 | Workaround for Existing Builds |
42 | ------------------------------ |
43 | |
44 | If you are using a build of GeoExt that includes the Ajax overrides (e.g. the |
45 | 0.6 release or earlier), you can work around any issues you may have using this |
46 | override in your appliction by protecting the ``Ext.lib.Ajax`` object before |
47 | loading file:`GeoExt.js`. |
48 | |
49 | The example markup below will remove the effect of the override on Ajax methods. |
50 | |
51 | .. code-block:: html |
52 | |
53 | <script src="path/to/ext.js"></script> |
54 | <script> |
55 | Ext.lib._Ajax = Ext.lib.Ajax; // protect the original |
56 | Ext.lib.Ajax = {}; // create dummy for override |
57 | </script> |
58 | <script src="path/to/GeoExt.js"></script> |
59 | <script> |
60 | Ext.lib.Ajax = Ext.lib._Ajax; // restore the original |
61 | </script> |
62 | |
63 | Note that issues with the Ajax override present in 0.6 will be fixed in |
64 | subsequent releases. |
Note: See TracBrowser
for help on using the repository browser.