The custom modes allow you display and select data that has absolutly nothing to do with dates. It uses the bare minimum of the datebox framework to provide the same UI to any matrix data you might have.
Shown below are the configuration options. This is the most complete documentation for this mode, but it does appear in the API as well.
- “themeOptPick” : Theme for centered data
- “themeOpt” : Theme for all other data
- “buttonIcon” : Theme for input button
- “customDataLen” : Length of picklist - you shouldn’t need to change this.
Set button text. Note that this really should be set in a language pack. But included here for easy use. If you needed to do a lot on a per page basis, something like:
Allows you to force the header text to whatever you specify. Leaving it false allows datebox to work as normal, grabbing either the placeholder attribute, or the label text (in that order of preference). If neither is found, it will be blank. Note that this option is not i18n aware.
The intended output format for the data. At a glance, valid options are %Xa … %Xe and %X1 … %X6 - if numeric, it will output the index of the data, if alphabetic, it will be the actual data. Note that re-opening the control when outputting the actual data is very error-prone, usually resulting in the control reverting to the “default” values. When left ‘false’, datebox will build an appropriate format of just the indexes.
The default selection for the data. This is an array of indexes. This must be set, as datebox can not really take a reasonable guess at your data. By default it is [0,0,0], which will choose the first data element of up to three sources.
customData takes an array of data objects, up to 6. (a/n: probably this isn’t checked, but 6 can be made to display somewhat ok). The objects must contain:
- input: Only used for customBox - show data in an input (true) or a div (false).
- name: The header text for the field - can be blank.
- data: A simple array of your data. Your data must be a string. Otherwise, it can be anything, including valid HTML.
Of particular note, if you pass this option a simple string, it will assume that it is a refernce to a global variable. For instance, if you pass in “myDataList”, DateBox will attempt to read “window.myDataList”.
Default. (customFormat === ‘%Xa’)
Slot Machine! (SET customFormat === ‘%X1,%X2,%X3’ FIRST)