JSAutoComplete

From GeoMedia Smart Client
Jump to: navigation, search
GMSC 2013/2014 Javascript API Overview Form Events Types Utility Functions client-side Validation Conditions Interaction with SmartClient Cookbook Cheatsheet
Form Models BaseModel FormModel TabModel GroupModel Field Models ActionModel
Field Models AutoComplete CheckBox ComboBox DatePicker DateTimePicker EditableComboBox Editor FilePicker Grid Hyperlink Image Label Password Radio TextArea TextField


The AutoComplete widget offers suggestions as a user types that come from remote data. In a second step the user selects one suggestion. An Autocomplete widget can be used to restrict a large amount of options (e.g. a huge contact database) to a much smaller, but relevant range. Since only the pre-filtered options are transferred to the client, the Autocomplete widget offers a good performance also in slower browsers. The AutoComplete widget is available since GMSC 2013.

Methods & Properties

The AutoComplete widgets inherits all methods and properties from BaseModel, the following methods have a different behaviour:

fill(values, selectedValue)

pre-fills the widget with a list of values and optionally selects the selected Value.


Parameters

{Array} values An array of objects containing the list-of-value items. Each item must have the following structure {id: 'valueOfItem', name: 'Label shown in the widget'}

{String} selectedValue (optional) value that should be pre-selected.

Example

Fill a list-of-value-widget (AutoComplete, Combobox or editable Combobox) with two items and pre-select the second one:

var lovWidget = IG.form.getItemById('LOV');
lovWidget.fill([{id: '1', name: 'First Item'},{id: '2', name: 'Second Item'}], '2');

Screenshot

Autocomplete.png