Skip to content

Commit 06ab509

Browse files
authored
docs(Dialog): Replace deprecated Filter event in the integration example (#3131)
* docs(Dialog): Update integration example with Filter * checkbox letter casing
1 parent 842bc94 commit 06ab509

File tree

1 file changed

+27
-30
lines changed

1 file changed

+27
-30
lines changed

components/dialog/integration.md

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ This article contains the following examples:
1919
* [Checkbox integration in Dialog](#checkbox-in-a-dialog)
2020
* [Filter integration in Dialog](#filter-in-a-dialog)
2121

22-
## Checkbox in a Dialog
22+
## CheckBox in a Dialog
2323

24-
To integrate the Checkbox in the Dialog:
24+
To use a CheckBox component in the Dialog:
2525

26-
1. Include the [Telerik Checkbox](slug:checkbox-overview) as `DialogContent`.
27-
1. Set the [`Value` parameter](slug:checkbox-overview#checkbox-parameters) of the Checkbox via two-way binding.
28-
1. Invoke the Dialog's `Refresh` method in the [`OnChange` event](slug:checkbox-events#onchange) of the Checkbox.
26+
1. Include the [Telerik CheckBox](slug:checkbox-overview) as `DialogContent`.
27+
1. Set the [`Value` parameter](slug:checkbox-overview#checkbox-parameters) of the CheckBox with two-way binding.
28+
1. Invoke the [Dialog `Refresh` method](slug:dialog-overview#dialog-reference-and-methods) in the [CheckBox `OnChange` event](slug:checkbox-events#onchange).
2929

30-
>caption Using Checkbox in Dialog
30+
>caption Using CheckBox in Dialog
3131
3232
````RAZOR
3333
@using Telerik.DataSource
@@ -53,50 +53,47 @@ To integrate the Checkbox in the Dialog:
5353

5454
## Filter in a Dialog
5555

56-
To integrate the Filter in the Dialog:
56+
To use a Filter component in the Dialog:
5757

58-
1. Include the [Telerik Filter](slug:filter-overview) as `DialogContent`.
59-
1. Set the [`Value` parameter](slug:filter-overview#filter-parameters) of the Filter via one-way binding.
60-
1. Invoke the Dialog's `Refresh` method in the [`ValueChanged` event](slug:filter-events#valuechanged) of the Filter.
61-
1. Update the `Value` parameter of the Filter manually in the `ValueChanged` event of the Filter.
58+
1. Include the [Telerik Filter](slug:filter-overview) inside `<DialogContent>`.
59+
1. Set the [`Value` parameter](slug:filter-overview#filter-parameters) of the Filter with one-way binding.
60+
1. Invoke the [Dialog `Refresh` method](slug:dialog-overview#dialog-reference-and-methods) in the [Filter `OnUpdate` event](slug:filter-events#onupdate).
6261

6362
>caption Using Filter in Dialog
6463
6564
````RAZOR
6665
@using Telerik.DataSource
6766
68-
<TelerikDialog @ref="DialogRef" Visible="true">
67+
<TelerikDialog @ref="DialogRef" Visible="true" Width="66vw" Height="66vh">
6968
<DialogContent>
70-
<TelerikFilter Value="@Value" ValueChanged="@OnValueChanged">
69+
<TelerikFilter Value="@FilterValue" OnUpdate="@OnFilterUpdate">
7170
<FilterFields>
72-
<FilterField Name="@(nameof(Person.EmployeeId))" Type="@(typeof(int))" Label="Id"></FilterField>
73-
<FilterField Name="@(nameof(Person.Name))" Type="@(typeof(string))" Label="First Name"></FilterField>
74-
<FilterField Name="@(nameof(Person.AgeInYears))" Type="@(typeof(int))" Label="Age"></FilterField>
71+
<FilterField Name="@(nameof(Product.Name))" Type="@(typeof(string))" />
72+
<FilterField Name="@(nameof(Product.Price))" Type="@(typeof(decimal))" />
73+
<FilterField Name="@(nameof(Product.Quantity))" Type="@(typeof(int))" />
74+
<FilterField Name="@(nameof(Product.Discontinued))" Type="@(typeof(bool))" />
7575
</FilterFields>
7676
</TelerikFilter>
7777
</DialogContent>
7878
</TelerikDialog>
7979
8080
@code {
81-
private TelerikDialog DialogRef { get; set; }
81+
private TelerikDialog? DialogRef { get; set; }
8282
83-
private TelerikFilter FilterRef { get; set; }
83+
private CompositeFilterDescriptor FilterValue { get; set; } = new();
8484
85-
private CompositeFilterDescriptor Value { get; set; } = new CompositeFilterDescriptor();
86-
87-
private void OnValueChanged(CompositeFilterDescriptor filter)
85+
private void OnFilterUpdate()
8886
{
89-
Value = filter;
90-
DialogRef.Refresh();
87+
DialogRef?.Refresh();
9188
}
9289
93-
public class Person
90+
public class Product
9491
{
95-
public int EmployeeId { get; set; }
96-
97-
public string Name { get; set; }
98-
99-
public int AgeInYears { get; set; }
92+
public int Id { get; set; }
93+
public string Name { get; set; } = string.Empty;
94+
public decimal Price { get; set; }
95+
public int Quantity { get; set; }
96+
public bool Discontinued { get; set; }
10097
}
10198
}
102-
````
99+
````

0 commit comments

Comments
 (0)