Databases Reference
In-Depth Information
3.
The Firebug screen should now display the Command Editor window as
shown in Figure 8-14.
Figure 8-14. Console Command Editor
From the Console Command Editor, you can run any JavaScript commands to test your code. It
usually helps to develop the code in the editor first, then move it into a static file. The advantage of this
approach is that you don't need to refresh your page each time you make a modification.
Console also provides a great logging API. The following links contain examples and screenshots of
the logging API:
http://getfirebug.com/logging - I ntro and screenshots
http://www.tuttoaster.com/learning-javascript-and-dom-with-console - S tep-
by-step demos and screenshots
http://getfirebug.com/wiki/index.php/Console_API - C onsole API
jQuery UI Widget Factory
When developing certain types of plug-ins, you will need to include some custom JavaScript code. In
some cases, this JavaScript code will be fairly simple. In other cases, the code may be more complex.
When developing more complex code, it helps to use a framework to standardize and simplify some of
the process.
The jQuery UI Widget Factory is a framework that allows you to build custom JavaScript code. It is
an extension of jQuery UI, which is already included with APEX, so there is no additional code that you
need to add in order to leverage your plug-ins.
This section will cover some of the basic structure around building code that leverages the Widget
Factory. It does not include all the information about the framework, but rather a brief summary to help
you get started. For more information, please read the main documentation page:
http://docs.jquery.com/UI_Developer_Guide#The_widget_factory .
The example below is a simple widget built using the jQuery UI Widget Factory framework that will
toggle the font size of an element. It is very basic and perfect for highlighting the fundamental items that
are required for the Widget Factory. It also includes some logging code to help highlight the functions
 
Search WWH ::




Custom Search