![]() | The Information Overlaid Toolkit: ; Referance Manual Edition 2.4, for Information Overlaid Version 2.4; 27th April 2004 | ![]() | ||
|---|---|---|---|---|
| Prev | Next | |||
Palette is a library designed to allow you to construct interfaces which allow the user to sift through a large number of entries downloaded from a sever by selecting features of entries they are interested in. The mechanics of Palette are contained in the ii_palette.js library. A library ii_palette_results.js is also provided, this defines all of the functions ii_palette.js requires to format results. You can use this in your initial development and then replace it with functions which output results in the format you prefer.
The ``Housing Estate'' tutorial gives a good introduction to how Palette works.
Names of the fields in each entry which should be treated as selectable fields (`types'). This will usually be set by a call to palette_start_entry_list.
Names of the fields in each entry which should not be treated as selectable fields. This will usually be set by a call to palette_start_entry_list.
The type or image number for markers created for entries when palette_marker_index does not give a more specific one.
An array which gives a marker type or a number for each type of entry. If some entry's type is not assigned a value here, the value of palette_marker_type is used.
For some purposes, for instance choosing a marker and sorting results, Palette needs to treat one type field as the most important one. This variable gives the position of that type in the call to palette_record_entry. The default is 3, ie the first type field.
If set, this parameter indicates that the indicated field is to be treated as the time of the entry.
If defined, this array should assign a number to each entry type. This will be used to sort the entries before displaying them. For more control you can define the palette_order_function callback.
If true, the results list will be split up by type with subheadings.
The window or frame into which the entries will be loaded. Defaults to the window hidden.
The window or frame into which the results list will be written. Defaults to the window results.
The index of the field which will be used to label the markers, if labels are required.
This is the basic function for setting the selection criteria. Note that if you use this the criteria can get out of step with the selectors the user is using. the palette_on_selected can be used to update the user interface if necessary, but in general the more specific functions below will be better.
Tells Palette that the given selectors should only be considered when looking at entries of type entrytype.
Looks at all the fields in form and any which are relevant to type field field will be turned on or off, as indicated by yesorno.
Makes the selection criteria match the given form. If update is true the results list is regenerated.
Set the relevant criterion from the given checkbox. Suitable for putting on the checkbox's onClick callback.
Set the relevant criteria from the given selector. Suitable for putting on the selector's onChange callback.
Remove all entries. If message is given it is displayed with palette_write_results_message.
Called at the start of a loading list of results. The two lists of field names define the names for the fields in the following calls to palette_record_entry. The ones in typefieldnames will be available as selection criteria. Message, if given, is displayed with palette_write_results_message.
Add an entry to the database. The values should correspond to the names in the call of palette_start_entry_list.
indicates the end of the list of results. Causes the results list to be updated.
In a mapping application, zoom to the most detailed map showing that entry.
You must define the following functions to tell Palette how to display results.
Writes the body tag for a page.
Writes the /body and any cleanup.
Called to write any text below the results list. The parameters are as for palette_write_results_top.
Called to write each result. The values parameter is an array giving values for each field in the entry.
The following callbacks can be defined to modify the behaviour of the system:
Called each time a type/value combination is selected or de-selected.
Writes the body tag for a page.
Writes the /body and any cleanup.
Called to write any text below the results list. The parameters are as for palette_write_results_top.
Called to write each result. The values parameter is an array giving values for each field in the entry.