|
30 | 30 | { |
31 | 31 | <span class="@ClearClassString" @onclick="OnClearValue"><i class="@ClearIcon"></i></span> |
32 | 32 | } |
33 | | - <div class="dropdown-menu"> |
34 | | - <div class="@SearchClassString"> |
35 | | - <input type="text" class="search-text form-control" autocomplete="off" value="@SearchText" aria-label="search"> |
36 | | - <i class="@SearchIconString"></i> |
37 | | - <i class="@SearchLoadingIconString"></i> |
38 | | - </div> |
| 33 | + <div class="@DropdownMenuClassString"> |
| 34 | + @if (ShowSearch) |
| 35 | + { |
| 36 | + <div class="dropdown-menu-search"> |
| 37 | + <input type="text" class="search-text form-control" autocomplete="off" value="@SearchText" aria-label="search"> |
| 38 | + <i class="@SearchIconString"></i> |
| 39 | + <i class="@SearchLoadingIconString"></i> |
| 40 | + </div> |
| 41 | + } |
39 | 42 | @if (IsVirtualize) |
40 | 43 | { |
41 | 44 | <div class="dropdown-virtual"> |
|
49 | 52 | } |
50 | 53 | </div> |
51 | 54 | } |
| 55 | + else if (Rows.Count == 0) |
| 56 | + { |
| 57 | + <div class="dropdown-item">@NoSearchDataText</div> |
| 58 | + } |
52 | 59 | else |
53 | 60 | { |
54 | | - @foreach (var itemGroup in Rows.GroupBy(i => i.GroupName)) |
55 | | - { |
56 | | - if (!string.IsNullOrEmpty(itemGroup.Key)) |
| 61 | + <div class="dropdown-menu-body"> |
| 62 | + @foreach (var itemGroup in Rows.GroupBy(i => i.GroupName)) |
57 | 63 | { |
58 | | - if (GroupItemTemplate != null) |
| 64 | + if (!string.IsNullOrEmpty(itemGroup.Key)) |
59 | 65 | { |
60 | | - @GroupItemTemplate(itemGroup.Key) |
| 66 | + if (GroupItemTemplate != null) |
| 67 | + { |
| 68 | + @GroupItemTemplate(itemGroup.Key) |
| 69 | + } |
| 70 | + else |
| 71 | + { |
| 72 | + <Divider Text="@itemGroup.Key" /> |
| 73 | + } |
61 | 74 | } |
62 | | - else |
| 75 | + @foreach (var item in itemGroup) |
63 | 76 | { |
64 | | - <Divider Text="@itemGroup.Key" /> |
| 77 | + @RenderRow(item) |
65 | 78 | } |
66 | 79 | } |
67 | | - @foreach (var item in itemGroup) |
68 | | - { |
69 | | - @RenderRow(item) |
70 | | - } |
71 | | - } |
72 | | - @if (Rows.Count == 0) |
73 | | - { |
74 | | - <div class="dropdown-item">@NoSearchDataText</div> |
75 | | - } |
| 80 | + </div> |
76 | 81 | } |
77 | 82 | </div> |
78 | 83 | @if (!IsPopover) |
|
0 commit comments