diff --git a/src/MatBlazor.Demo/Demo/DemoAutocomplete.razor b/src/MatBlazor.Demo/Demo/DemoAutocomplete.razor
index aeb474e0..f3c8e707 100644
--- a/src/MatBlazor.Demo/Demo/DemoAutocomplete.razor
+++ b/src/MatBlazor.Demo/Demo/DemoAutocomplete.razor
@@ -1,19 +1,14 @@
+
+ Selected value: @(value?.Name) +
+ + @code + { + + public class Car + { + public string Name { get; set; } + public double Price { get; set; } + + public Car(string name, double price) + { + Name = name; + Price = price; + } + } + + Car value = null; + + Car[] options2 = new[] + { + new Car("Volkswagen Golf", 10000), + new Car("Volkswagen Passat", 11000), + new Car("Volkswagen Polo", 12000), + new Car("Ford Focus", 13000), + new Car("Ford Fiesta", 14000), + new Car("Ford Fusion", 15000), + new Car("Ford Mondeo", 16000), + }; + + } + ++ Selected value: @(value?.Name) +
+ + @code + { + + public class Car + { + public string Name { get; set; } + public double Price { get; set; } + + public Car(string name, double price) + { + Name = name; + Price = price; + } + } + + Car value = null; + + Car[] options2 = new[] + { + new Car(""Volkswagen Golf"", 10000), + new Car(""Volkswagen Passat"", 11000), + new Car(""Volkswagen Polo"", 12000), + new Car(""Ford Focus"", 13000), + new Car(""Ford Fiesta"", 14000), + new Car(""Ford Fusion"", 15000), + new Car(""Ford Mondeo"", 16000), + }; + + } + + ")>This is useful when you have a backend with pagination based on the search text and you want to use the pagination directly in the backend server.
+Name | +Type | +Description | +
---|---|---|
TItem | +Generic argument | ++ |
ListResult | +List<MatAutocompleteItem<TItem>> | ++ |
SearchText | +String | ++ |
Name | +Type | +Description | +
---|---|---|
TItem | +Generic argument | ++ |
Base class for any input control that optionally supports an .
+The autocomplete is a normal text input enhanced by a panel of suggested options.
Type | Description | ||||
---|---|---|---|---|---|
TValue | -Generic argument | -- | |||
TItem | Generic argument | -+ | Type of items. | ||
Attributes | @@ -44,6 +39,11 @@String | Specifies one or more classnames for an DOM element. | |||
CustomStringSelector | +Func<TItem,String> | +Gets or sets the function used to select the string part from the item, used both for filtering and displaying if no is given. | +|||
Dense | Boolean | @@ -122,17 +122,17 @@||||
Items | IEnumerable<TItem> | -+ | Gets or sets the items source which will be filtered and displayed in the dropdown list. | ||
ItemTemplate | -RenderFragment<TItem> | -ItemTemplate is used to render the elements in the popup if no template is given then the string value of the objects is displayed.. | +ItemsSource | +IAutocompleteItemsSource<TItem> | +Gets or sets the items source for autocomplete items. If provided, is ignored and everytime the user is typing something, this source will be used to populate the items in the dropdown list. |
ItemValueSelector | -Func<TItem,TValue> | -This function is used to select the string part from the item, used both for filtering and displaying if no ItemTemplate is defined. | +ItemTemplate | +RenderFragment<TItem> | +Gets or sets the template used to render the elements in the popup, if no template is given then the string value of the objects is displayed. |
Label | @@ -142,7 +142,7 @@|||||
NumberOfElementsInPopup | Nullable<Int32> | -Maximum number of elements displayed in the popup | +Gets or sets the maximum number of elements displayed in the dropdown list. | ||
OnFocus | @@ -174,6 +174,11 @@EventCallback<KeyboardEventArgs> | ||||
OnOpenedChanged | +EventCallback<Boolean> | +Gets or sets the event callback which is invoked when the dialog is opened or closed. The parameter will be "true" if the dialog was opened, "false" otherwise. | +|||
Outlined | Boolean | @@ -199,6 +204,21 @@Boolean | |||
SelectedItem | +TItem | +Gets or sets the selected item from the dropdown list. | +|||
SelectedItemChanged | +EventCallback<TItem> | +ValueChanged is fired when the value is selected(by clicking on an element in the popup) | +|||
ShowClearButton | +Boolean | +Gets or sets the visibility of the clear button. The default value is "false". If the clear button is displayed and pressed, the text and selected value will be cleared. | +|||
Style | String | @@ -221,17 +241,17 @@||||
Value | -TValue | +String | Gets or sets the value of the input. This should be used with two-way binding. | ||
ValueChanged | -EventCallback<TValue> | +EventCallback<String> | Gets or sets a callback that updates the bound value. | ||
ValueExpression | -Expression<Func<TValue>> | +Expression<Func<String>> | Gets or sets an expression that identifies the bound value. | ||
Type | Description | ||||
TValue | -Generic argument | -- | |||
TItem | Generic argument | @@ -29,7 +24,7 @@||||
Value | -TValue | +String |