When Ext was first being developed (initially called "yui-ext"), it required the YUI library to be in place to do the behind-the-scenes work. Later on, Ext was given the option of using two other frameworks—jQuery or Prototype with Scriptaculous (Protaculous).
This means that if we were using other libraries already or if we felt some other base library was somehow superior or better suited your needs, we could continue using that library in conjunction with Ext by using the appropriate adapter. Either way, Ext will function the same, and all of the components will work identically, no matter which adapter you choose.
Ext also has its own adapter, an adapter to itself. If you have no preference for another library or framework, then go with the Ext built-in the adapter.
To use an adapter, you must first include the external library that you want to use, and then include the related adapter file that is located in the adapters folder of the Ext SDK. Our example code uses the Ext adapter. To use any of the other libraries, just replace the default Ext adapter script include line with the lines for the specific libraries, as shown below:
Default Ext adapter:
<script src="lib/extjs/adapter/ext/ext-base.js"></script>
For jQuery, include these files in the head of your document:
<script src="lib/jquery.js"></script> <script src="lib/jquery-plugins.js"></script> <script src="lib/extjs/adapter/jquery/ext-jquery-adapter.js"> </script>
For YUI, include these files in the head. The utilities
file is located in the build/utilities
folder of the YUI Library download:
<script src="lib/utilities.js"></script> <script src="lib/extjs/adapter/yui/ext-yui-adapter.js"></script>
For "Prototype + Scriptaculous", include these files in the head:
<script src="lib/prototype.js"></script> <script src="lib/scriptaculous.js?load=effects"></script> <script src="lib/extjs/adapter/prototype/ ext-prototype-adapter.js"></script>
After the adapter and base libraries have been included, we just need to include the ext-all.js
or ext-all-debug.js
file.