|
89 | 89 | var isFilterable = AllowFiltering && row?.Filterable == true; |
90 | 90 | var sortOrder = row?.GetSortOrder(); |
91 | 91 | var hasActiveFilter = row?.HasActiveFilter() == true; |
| 92 | + var filterIconRefKey = $"row{row.GetFilterProperty()}"; |
92 | 93 | <tr class="rz-pivot-header-row"> |
93 | 94 | <th class="rz-pivot-row-header @(isSortable ? "rz-sortable-column" : "")" style="width:100%;margin-top:5px;"> |
94 | 95 | <div class="rz-pivot-header-content-wrapper"> |
|
117 | 118 | </div> |
118 | 119 | @if (isFilterable) |
119 | 120 | { |
120 | | - <i @ref="FilterIconRef[row]" @onclick:stopPropagation="true" |
121 | | - @onmousedown="@(() => ToggleFilter(row))" |
| 121 | + <i @ref=FilterIconRef[filterIconRefKey] @onclick:stopPropagation="true" |
| 122 | + @onmousedown="@(() => ToggleFilter(row, filterIconRefKey))" |
122 | 123 | class="@GetFilterIconCss(row)" |
123 | 124 | title="Filter"> |
124 | 125 | @FilterIcon |
|
141 | 142 | var isFilterable = AllowFiltering && column?.Filterable == true; |
142 | 143 | var sortOrder = column?.GetSortOrder(); |
143 | 144 | var hasActiveFilter = column?.HasActiveFilter() == true; |
144 | | - |
| 145 | + var filterIconRefKey = $"col{column.GetFilterProperty()}"; |
145 | 146 | <tr class="rz-pivot-header-row"> |
146 | 147 | <th class="rz-pivot-column-header @(isSortable ? "rz-sortable-column" : "")" style="width:100%;margin-top:5px;"> |
147 | 148 | <div class="rz-pivot-header-content-wrapper"> |
|
170 | 171 | </div> |
171 | 172 | @if (isFilterable) |
172 | 173 | { |
173 | | - <i @ref="FilterIconRef[column]" @onclick:stopPropagation="true" |
174 | | - @onmousedown="@(() => ToggleFilter(column))" |
| 174 | + <i @ref=FilterIconRef[filterIconRefKey] @onclick:stopPropagation="true" |
| 175 | + @onmousedown="@(() => ToggleFilter(column, filterIconRefKey))" |
175 | 176 | class="@GetFilterIconCss(column)" |
176 | 177 | title="Filter"> |
177 | 178 | @FilterIcon |
|
194 | 195 | var isFilterable = AllowFiltering && column?.Filterable == true; |
195 | 196 | var sortOrder = column?.GetSortOrder(); |
196 | 197 | var hasActiveFilter = column?.HasActiveFilter() == true; |
197 | | - |
| 198 | + var filterIconRefKey = $"agg{column.GetFilterProperty()}"; |
198 | 199 | <tr class="rz-pivot-header-row"> |
199 | 200 | <th class="rz-pivot-column-header @(isSortable ? "rz-sortable-column" : "")" style="width:100%;margin-top:5px;"> |
200 | 201 | <div class="rz-pivot-header-content-wrapper"> |
|
223 | 224 | </div> |
224 | 225 | @if (isFilterable) |
225 | 226 | { |
226 | | - <i @ref="FilterIconRef[column]" @onclick:stopPropagation="true" |
227 | | - @onmousedown="@(() => ToggleFilter(column))" |
| 227 | + <i @ref=FilterIconRef[filterIconRefKey] @onclick:stopPropagation="true" |
| 228 | + @onmousedown="@(() => ToggleFilter(column, filterIconRefKey))" |
228 | 229 | class="@GetFilterIconCss(column)" |
229 | 230 | title="Filter"> |
230 | 231 | @FilterIcon |
|
427 | 428 | <!-- Filter Popup --> |
428 | 429 | @if (AllowFiltering && currentFilterField != null) |
429 | 430 | { |
| 431 | + var prefix = currentFilterField is RadzenPivotColumn<TItem> ? "col" : currentFilterField is RadzenPivotRow<TItem> ? "row" : "agg"; |
| 432 | + var filterIconRefKey = $"{prefix}{currentFilterField.GetFilterProperty()}"; |
430 | 433 | <Popup @ref="filterPopup" id="@($"pivot-filter-{currentFilterField.Property}")" class="rz-overlaypanel" |
431 | | - style="display:none;min-width:250px;" @onkeydown="OnFilterPopupKeyPressed"> |
| 434 | + style="display:none;min-width:250px;" @onkeydown=@(args => OnFilterPopupKeyPressed(args, filterIconRefKey))> |
432 | 435 | <div class="rz-overlaypanel-content"> |
433 | 436 | @if (currentFilterField.FilterTemplate != null) |
434 | 437 | { |
435 | 438 | @currentFilterField.FilterTemplate(currentFilterField) |
436 | 439 | } |
437 | 440 | else |
438 | 441 | { |
439 | | - <form id="@($"pivot-filter-{currentFilterField.Property}-form")" @onsubmit="@(args => ApplyFilter())" class="rz-grid-filter"> |
| 442 | + <form id="@($"pivot-filter-{currentFilterField.Property}-form")" @onsubmit="@(args => ApplyFilter(filterIconRefKey))" class="rz-grid-filter"> |
440 | 443 | <span class="rz-grid-filter-label">@FilterText</span> |
441 | 444 | <RadzenDropDown InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", FilterOperatorAriaLabel + GetFilterOperatorText(currentFilterField.GetSecondFilterOperator()) }})" |
442 | 445 | @onclick:preventDefault="true" Data="@(GetFilterOperators(currentFilterField).Select(t => new { Value = GetFilterOperatorText(t), Key = t }))" TextProperty="Value" ValueProperty="Key" TValue="FilterOperator?" Value="@currentFilterField.GetFilterOperator()" Change="@(args => SetFilterOperator(currentFilterField, (FilterOperator)args))" /> |
|
505 | 508 | </form> |
506 | 509 | <div class="rz-grid-filter-buttons"> |
507 | 510 | <RadzenButton ButtonStyle="ButtonStyle.Primary" ButtonType="ButtonType.Submit" Text="@ApplyText" class="rz-button-sm" /> |
508 | | - <RadzenButton ButtonStyle="ButtonStyle.Light" Text="@ClearText" Click="@ClearFilter" class="rz-button-sm" /> |
| 511 | + <RadzenButton ButtonStyle="ButtonStyle.Light" Text="@ClearText" Click="@(args => ClearFilter(filterIconRefKey))" class="rz-button-sm" /> |
509 | 512 | </div> |
510 | 513 | } |
511 | 514 | </div> |
|
0 commit comments