https://rawb.codeplex.com/SourceControl/latest#Rawb/Rawb/js/rawb.ui.js

rawb.DropDown({arg, ...})

The DropDown is a more versatile version of the HTML 'select' control,
supporting autocompletion, on-demand and asynchronous data fetching,
and interactive filtering and sorting.

Example HTML:
<!-- ko template: { name: 'RawbDropDownTemplate', data: dd } -->
<!-- /ko -->

Example JavaScript:
var options = ko.observable([{a: "Alice", b: 1}, {a: "Bob", b: 2}, {a: "Cissy", b: 3}]);
var dd = new rawb.DropDown({options: options, fieldName: "a"});
ko.applyBindings({dd: dd});

Invariant

If the input exactly matches a filtered field in options, then selection is set
to the first such field. Otherwise selection is set to undefined.

Parameters

input: observable string
Optional (default ""); exposed as observable.
The text displayed in the input box, reflecting either the
current selection or what the user has typed in.

enabled: boolean
Optional (default true); may be observable; exposed as observable.
If true, the input field is enabled.
If false, the input field is disabled.

options: array of object
Optional (default []); exposed as observable.
The array of option objects from which a selection may be made
(note that this must be an array of objects, it cannot be an
array of scalars, such as numbers, strings, dates, etc.).

fieldName: string
Required; must not be an observable; exposed as non-observable.

The name of the field in the options objects against which
input is matched to decide the value of selection.

selection: observable object
Optional (default undefined); must be writable observable; exposed as observable.
The first value x drawn from options such that xfieldName exactly
matches input (selection is undefined if there is no such match).

matchFn: function (DropDown) -> array of Match
Optional (default is built-in).

The function used to filter and order options partially matching
input, returning a list of Match objects (see below).

The default matchFn deems the input to match all options where the input is a
(case insensitive) substring of the option fieldName property.

The default match comparison function used for ordering is matchComparisonFn (see below).

The DropDown control invokes matchFn whenever the input or options are updated.
The matchFn must (a) filter out options which do not match the input, (b) order the
options which do match the input, and (c) convert those matching options into Match
objects (see below).

Match objects: { option: object, all: string, match: { prefix: string, match: string, suffix: string } }
The default matchComparisonFn and matchTemplateID HTML template assume each Match
record will include the fields listed:
option is the matching item from options;
all is the complete optionfieldName value;
prefix is the part of the fieldName value preceding the match against input;
match is the part of the fieldName value matching the input (the case may be different);
suffix is the part of the fieldName value following the match against input.

matchComparisonFn: function (Match, Match) -> number
Optional (default is built-in).

The default match comparison function orders as follows: matches with empty prefixes
preceed those with non-empty prefixes; within each partition, matches are alphabetically sorted
in case insensitive fashion.

fetchFn: function (DropDown)
Optional (default does nothing).

The function used to update options in response to the input changing.
This allows options to be fetched, e.g., via an AJAX call.

matchTemplateID: string
Optional (default "RawbDropDownMatchTemplate").

The HTML template used to display matches in the drop-down grid.

width: number
Optional (default 200); may be observable; exposed as observable.

The width in pixels of the input field and drop-down grid.

inputHeight: number
Optional (default 20); may be observable; exposed as observable.

The height in pixels of the input field.

gridHeight: number
Optional (default 200); may be observable; exposed as observable.

The maximum height in pixels of the drop-down grid.

gridRowHeight: number
Optional (default 24); may be observable; exposed as observable.

The maximum height in pixels of each match row in the drop-down grid.

gridFieldWidth: number
Optional (default 1000); may be observable; exposed as observable.

The scrollable width in pixels of each match row in the drop-down grid (only
needed if the hScrollBarHeight has been set).

gridVScrollBarWidth: number
Optional (default 10); may be observable; exposed as observable.

The width in pixels of the vertical scrollbar on the drop-down grid (only displayed
when there are more matches than can be displayed in the given gridHeight).

gridHScrollBarHeight: number
Optional (default 0); may be observable; exposed as observable.

The height in pixels of the horizontal scrollbar (setting this to zero means
no horizontal scrollbar will be displayed).

Methods

dispose(): function ()
Disposes Knockout subscriptions created by the DropDown.
Use this when the DropDown goes out of scope if you are concerned about memory leaks.