ComboBox
The values of the control "ComboBox" can be provided as static datasource (data formatted like a Json Array inside your template) or in case of a external datasource e.g. by referencing a SharePoint list by linking to the URL or by providing a oData source.
static datasource:
<div
id="technician"
data-hf-control="ComboBox"
data-hf-options="{
label: 'Technician',
required: true,
dataSource: [
{ name: 'Bauer, F', code: 'Bauer, F' },
{ name: 'Gruber, P', code: 'Gruber, P' },
{ name: 'Lanner, G', code: 'Lanner, G' },
{ name: 'Simon, R', code: '3521' },
{ name: 'Herbert, W', code: '123456789012' }
],
dataTextField: 'name',
dataValueField: 'code'
}"
></div>
external datasource (URL):
<div
id="tab1_combobox_liste"
data-hf-control="ComboBox"
data-hf-options="{
label: 'ComboBox (HFSql Catalogs)',
list: true,
minLength: 3,
url: '/api/catalogs/CatalogName?$select=Title,KatalogText,PLZ,Postort&%24orderby=Title,PLZ&%24top=1000',
template: HFFormdefinition.Namespace.setStreetTemplate,
dataTextField: 'KatalogText',
dataValueField: 'Title'
}"
></div>
multilingual external datasource (URL):
<div
id="tab1_combobox_liste"
data-hf-control="ComboBox"
data-hf-options="{
label: 'ComboBox (HFSql Catalogs)',
list: true,
minLength: 3,
template: HFFormdefinition.Namespace.setStreetTemplate,
url: '/api/catalogs/Items?$select=Title,KatalogText,Streetname,Strassenname&%24orderby=Title,PLZ&%24top=1000',
i18nDataTextField: {
en: 'Streetname',
de: 'Strassenname',
default: 'Streetname'
},
dataValueField: 'Title'
}"
></div>
external datasource (oData):
<div
id="liveOdataSource"
data-hf-control="ComboBox"
data-hf-options="{
label: 'Combobox with live OData source',
required: true,
dataTextField: 'KatalogText',
dataValueField: 'Title',
autoBind: false,
dataSource: {
type: 'odata',
transport: {
read: {
url:'https://example.com/liveOdataSource/?select=Title,KatalogText&orderby=KatalogText',
dataType: 'json',
headers: {
'Accept': 'application/json;odata=verbose'
}
}
}
}
}"
></div>
FormControl Optionsβ
Options of the kendo component are also available. read more
dataTextField - requiredβ
dataTextField: 'name'stringdataValueField - requiredβ
dataValueField: 'code'stringanytextβ
anytext: falsebooleantruecheckValueInitiallyβ
checkValueInitially: truebooleantruedataSourceβ
dataSource: [{name: 'Bauer, F', code: 'Bauer, F'}, {name: 'Gruber, P', code: 'Gruber,P'}]json pseudo arraydefaultValueβ
defaultValue: 'Title1',string | functionfunction() => stringdisabledβ
disabled: truebooleandoNotCopyβ
doNotCopy: truebooleanfilterItemsβ
contains. More infos[{ field: 'name', operator: 'contains' }, { field: 'address' }]{ field: string; operator?: string; }[]formControlMappingβ
{ example_id: 'example_key' }IFormControlMappinghighlightTemplateβ
highlight as default placeholder for the highlighted text.highlightTemplate: '<strong>#: highlight #</strong>'stringi18nDataTextFieldβ
{ en: 'Streetname', de: 'PLZ', default: βStreetname' }{ default: string, [langCode: string]: string }itemTemplateβ
template option, itemTemplate keeps the original filter highlighting.itemTemplate: '<span>#: entry1 # - #: entry2 #</span>'string | functionfunction(item: any) => stringlistβ
list: truebooleanlistOptionsβ
{ dialogText: string, dialogHide: boolean }minLengthβ
minLength: 3numberonChangedβ
onChanged: HFFormdefinition.Namespace.Methodfunctionfunction(data: { value: string, text: string }) => voidpagingβ
paging: truebooleanpagingItemHeightβ
34.pagingItemHeight: 40numberpersistentβ
persistent: 'user''user'placeholderβ
placeholder: 'Please select ...'stringtooltipβ
tooltip: 'Please indicate at least one cause of damage.'stringtooltipTemplateβ
tooltipTemplate: 'example_control_tooltip'stringurlβ
url: '/_api/web/lists/getbytitle('SP')/Items?$select=Title&$orderby=Title'stringvalueMapperDelayβ
valueMapperDelay: truebooleanvisitingβ
visiting: truebooleanlistOptions Objectβ
dialogTextβ
dialogText: 'Display Text'stringPlease follow the conventions to build an OData Source Link by considering the following documentations:
formControlMapping
βThe mapping objects consist of keys which are the Form Control IDs to copy to and the value which can be a data source key or an object with the data source key and a format function.
By every value change the specified data source entries are copied to the given Form Controls.
<div
id="exmaple_mapping"
data-hf-control="ComboBox"
data-hf-options="{
label: 'Example',
url: '/api/catalogs/Example?$select=Text,Value,Description,Date',
dataTextField: 'Text',
dataValueField: 'Value',
formControlMapping: {
description: 'Description',
date_picker: {
key: 'Date',
callback: HFFormdefinition.ExampleNamespace.formatDateFunc
}
}
}"
></div>
type FormControlMappingType = {
key: string;
callback: (dataItem: any, dataKey: string) => any;
};
interface IFormControlMapping {
[id: string]: string | FormControlMappingType;
}
Stored data
β<div
id="technician"
data-hf-control="ComboBox"
data-hf-options="{
label: 'Technician',
dataSource: [
{ name: 'Bauer, F', code: 'Bauer, F' },
{ name: 'Gruber, P', code: 'Gruber, P' },
{ name: 'Lanner, G', code: 'Lanner, G' },
{ name: 'Simon, R', code: '3521' },
{ name: 'Herbert, W', code: '123456789012' }
],
dataTextField: 'name',
dataValueField: 'code',
required: true
}"
></div>
For each ComboBox inside your Forms there are two value pairs of stored data:
First the information for the ComboBox itself
{
"id": "technician",
"value": "3521"
}
and second for the selected value:
{
"id": "technician_HFComboText",
"value": "Simon, R"
}