MultiSelect
The values of the control "MultiSelect" 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 HybridForms catalog by linking to the URL or by providing an oData source.
Static datasource:
<div
id="technician"
data-hf-control="MultiSelect"
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_multiselect_liste"
data-hf-control="MultiSelect"
data-hf-options="{
label: 'MultiSelect (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_multiselect_liste"
data-hf-control="MultiSelect"
data-hf-options="{
label: 'MultiSelect (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="MultiSelect"
data-hf-options="{
label: 'MultiSelect 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'stringcheckValueInitially
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; }[]highlightTemplate
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 }onChanged
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:
copyValueFrom
Define a FormControl that synchronizes its value with the current field. This synchronization process occurs upon navigating to the page where the current control is situated. It only occurs if the field is empty or the mode is set to "overwrite".
<div
id="tab1_multiselect_liste"
data-hf-control="MultiSelect"
data-hf-options="{
label: 'MultiSelect (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',
copyValueFrom: 'tab1_multiselect_liste_2'
}"
></div>
interface ICopyValueFromObject {
sourceId: string;
mode: 'overwrite' | null;
callback: (value: string) => string;
}
type CopyValueFromType = string | ICopyValueFromObject;
callback
callback: HFFormDefinition.Namespace.processValuefunctionfunction(value: string) => stringmode
mode: 'overwrite'stringStored data
<div
id="technician"
data-hf-control="MultiSelect"
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 MultiSelect inside your Forms there are two value pairs of stored data:
First the information for the MultiSelect itself...
{
"id": "technician",
"value": "3521|Lanner, G"
}
...and second for the selected value:
{
"id": "technician_HFText",
"value": "Simon, R|Lanner, G"
}