-
Book Overview & Buying
-
Table Of Contents
Oracle Application Express 4.0 with Ext JS
By :
Many of the APIs provided by Ext use a config object to pass configuration settings to a JavaScript function. So what exactly is this config object, and why use it?
The config object is an object literal, which we will learn about shortly. We use it because it's more flexible and is self documenting.
Using old school JavaScript programming, a typical function looked like this:
function show_prompt(title, message, width) {
// code
}
To call that code, you would write:
var answer = show_prompt('my title','a short message', 300);
While this isn't too bad for this example, as a developer you have to call the function passing parameters in the order specified, and you must pass all parameters. In a few months time, an issue gets raised, and looking at the function call you have absolutely no idea what 300 is about without digging around to find the function definition.
The new way of passing parameters is done using...
Change the font size
Change margin width
Change background colour