MentionModel
Interface representing the Mention class.
Properties
actionFailureText String
Specifies the text to be displayed when a remote request fails.
Default: Error occurred in the request
allowSpaces Boolean
Specifies whether to allow a space to be entered in the middle of the mentioned text while searching. When disabled, a space will end the mention search.
Default: false
cssClass String
Specifies CSS classes to customize the appearance of the control.
Default: null
dataStore {:} DataStore String[]
Specifies a list of items that should be bound to the control either via a local object or a remote data source.
Default: []
displayTemplate Function
Specifies a template to customize how the items in the suggestion list are displayed.
Default: null
enableRtl Boolean
Specifies whether to render the control in right to left direction.
Default: false
enableState Boolean
Specifies whether to persist the state of the control between page loads.
- value
Default: false
fields ItemSettingsModel
Specifies the property mapping for the data source columns to the items in the list.
Default: { }
filterType FilterType
Specifies the type of filter to be used when filter the list items.
Default: StartsWith
highlight Boolean
Specifies whether to highlight the searched characters in the suggestion list.
Default: false
ignoreAccent Boolean
Specifies whether to ignore diacritic characters when filtering the list items.
Default: false
ignoreCase Boolean
Specifies whether to ignore the case, make case-sensitive, when filtering the list items.
Default: true
itemTemplate Function
Specifies a template to customize how the individual list items are displayed in the popup.
Default: null
locale String
Specifies the culture and localization value for this control, overriding the globally defined value.
Default: en-US
mentionChar String
Specifies a symbol or a single character that will trigger the search action and show the suggestion list.
Default: @
minLength Number
Specifies the minimum number of characters that need to be entered by the user before searching begins and the suggestion list is shown. The default value of zero means the search will begin once the mentionChar is entered.
Default: 0
noRecordsText String
Specifies the text to be displayed when there are no records to be displayed.
Default: No records found
placeholder String
Specifies a short description of what is expected to be within the list of items.
Default: null
popupHeight Number String
Specifies the height of the popup expressed in pixels.
Default: 300px
popupWidth Number String
Specifies the width of the popup expressed in pixels. By default, the width of the popup is the width of the control. Value can be expressed in percent or pixels.
Default: auto
query Query
Specifies a query that will be executed against the data source before the data source results are bound to the control.
Default: null
showMentionChar Boolean
Specifies whether to show the mentionChar with the text value selected from the suggestion list.
Default: false
suffix String
Specifies custom text that will be appended to the selected value from the suggestion list.
Default: null
suggestionCount Number
Specifies the number of items to show in the suggestion list.
Default: 25
zIndex Number
Specifies the zIndex of the popup.
Default: 1000
Methods
addEventListener
Attaches an event handler to a specified element. This method allows you to set up a function that will be called whenever the specified event is delivered to the target element.
Parameter | Type | Description |
---|---|---|
eventName | String | A string value that specifies the name of the event. |
handler | Function | Specifies the function to run when the event is triggered. |
Returns: Void
addItem
Adds a new list item to the list box. By default, the newly created item will append to the end of the list unless an index parameter is given.
Parameter | Type | Description |
---|---|---|
data | Object Object[] | Specifies the JSON data to be added to the list. |
index | Number | Specifies the index to position the newly created item within in the popup list. |
Returns: Void
appendTo
Appends the control to the specified HTML element.
Parameter | Type | Description |
---|---|---|
selector | String HTMLElement | The select to a specified HTML element or an HTML element where the control will be appended to. |
Returns: Void
dataBind
Applies all pending property changes to the control.
Returns: Void
destroy
Destroys the Aware instance, detaches all related events, removes attributes, css classes and restores the root element.
Returns: Void
getItems
Gets all list items currently bound to the control.
Returns: Element[]
getLocalData
Gets the current properties values for the accordion that will be persisted to the state.
Returns: String
getRootElement
Gets the root element of the control.
Returns: HTMLElement
getStateData
Gets the current persisted state data for the control.
Returns: String
hidePopup
Hides the popup list if showing.
Returns: Void
hideSpinner
Hides the loading spinner if it is showing.
Returns: Void
refresh
Applies all pending property changes to the accordion and re-renders the control.
Returns: Void
removeEventListener
Removes the attached event handler for the specified event listener.
Parameter | Type | Description |
---|---|---|
eventName | String | A string value that specifies the name of the event to be removed. |
handler | Function | Specifies the function to be removed. |
Returns: Void
showPopup
Shows the popup containing the list items.
Returns: Void
showSpinner
Shows the loading spinner for the control.
Returns: Void
Events
actionBegin EmitType<ActionBeginEventArgs>
Event callback that is raised before retrieving data from the data store.
actionComplete EmitType<ActionCompleteEventArgs>
Event callback that is raised after data has been retrieved from the data store.
actionFailure EmitType<Object>
Event callback that is raised when there is a failure in retrieving data from the data store.
beforeOpen EmitType<BeforeOpenEventArgs>
Event callback that is raised before the popup opens.
change EmitType<MentionChangeEventArgs>
Event callback that is raised when the value has changed, either by a user selecting a value or by the value property being changed.
closed EmitType<PopupEventArgs>
Event callback that is raised when the popup is closed.
created EmitType<CreatedEventArgs>
Event callback that is raised when the control has been created.
dataBound EmitType<DataBoundEventArgs>
Event callback that is raised when data has been bound to the control.
destroyed EmitType<Object>
Event callback that is raised when the control has been destroyed.
filtering EmitType<FilteringEventArgs>
Event callback that is raised when the list of items is filtered by typing in the textbox.
opened EmitType<PopupEventArgs>
Event callback that is raised when the popup is opened.
select EmitType<SelectEventArgs>
Event callback that is raised when an item in the popup list is selected, either by a mouse/tap event or navigating the list using the keyboard.