MatchTagsField
Summary
Defines a MatchTagsField.
A MatchTagsField is a field part of a match, it is pretty much like a TagsField except that it is part of a match.
Constructor
Item Index
Methods
Properties
Methods
addMatchValue
Syntax
Summary
Adds a new match using add button, text field and tags field.
Returns:
Promise resolving when match has been added
addMatchValueUsingAutoCompletion
Syntax
Summary
Adds a new match using add button, text field and tags field with auto completion.
Returns:
Promise resolving when match has been added
clear
Syntax
Summary
Clears field value by removing all tags.
Returns:
Promise resolving when the field is cleared
Example:
myField.clear().then(function() {
console.log('Field cleared');
});
getAddLabel
Syntax
Summary
Gets the add button label.
Returns:
Promise resolving with the button label
Example:
myField.getAddLabel().then(function(label) {
console.log('Add button label: ' + label);
});
getDescription
Syntax
Summary
Gets field description.
Returns:
Promise resolving with the description
Example:
myField.getDescription().then(function(description) {
console.log('Field description is : ' + description);
});
getElement
Syntax
Summary
Gets match tags field element wrapper.
Returns:
Promise resolving with the element
getErrorMessage
Syntax
Summary
Gets field error message.
Returns:
Promise resolving with the error message
Example:
myField.getErrorMessage().then(function(errorMessage) {
console.log('Error message : ' + errorMessage);
});
getInputPlaceholder
Syntax
Summary
Gets the input placeholder.
Returns:
Promise resolving with the input placeholder
Example:
myField.getInputPlaceholder().then(function(placeholder) {
console.log('Input placeholder: ' + placeholder);
});
getLabel
Syntax
Summary
Gets field label.
Returns:
Promise resolving with the label
Example:
myField.getLabel().then(function(label) {
console.log('Field label is : ' + label);
});
getMatchValue
Syntax
Summary
Gets value of a match.
Returns:
Promise resolving with the value of the match
getTagsPlaceholder
Syntax
Summary
Gets the tags placeholder.
Returns:
Promise resolving with the tags placeholder
Example:
myField.getTagsPlaceholder().then(function(placeholder) {
console.log('Tags placeholder: ' + placeholder);
});
getText
Syntax
Summary
Gets field text representation in case of an inline editable field.
Returns:
Promise resolving with field text representation
Example:
myField.getText().then(function(text) {
console.log(text);
});
getValue
Syntax
Summary
Gets field value, the list of associations (matches).
Returns:
Promise resolving with the list of matches
Example:
myField.getValue().then(function(matches) {
console.log(matches);
});
isOnError
Syntax
Summary
Tests if field is considered as on error.
Returns:
Promise resolving with a boolean indicating if the field is on error
Example:
myField.isOnError().then(function(isOnError) {
console.log('Is field on error ? ' + isOnError);
});
removeMatch
Syntax
Summary
Removes a match by clicking on the remove button.
Returns:
Promise resolving with the value of the match
selectTagInAutoComplete
Syntax
Summary
Selects a tag in auto complete.Parameters:
-
The
Stringvalue of the tag to select in the auto complete. It should be the same value as the one in the available options
Returns:
setValue
Syntax
Summary
Sets field value.
Parameters:
-
[values]
Array optionalList of matches
Returns:
Promise resolving when the field is filled
Example:
myField.setValue([
{
text: 'text',
tags: ['tags1', 'tags2', 'tags3']
},
{
text: 'text2',
tags: ['tags4', 'tags5', 'tags6']
}
]).then(function() {
console.log('Value set');
});
setValueUsingAutoCompletion
Syntax
Summary
Sets field value using auto completion.
Parameters:
-
[values]
Array optionalList of matches
Returns:
Promise resolving when the field is filled
Example:
myField.setValueUsingAutoCompletion([
{
text: 'text',
tags: ['tags1', 'tags2', 'tags3']
},
{
text: 'text2',
tags: ['tags4', 'tags5', 'tags6']
}
]).then(function() {
console.log('Value set');
});