Skip to content

Commit d745af2

Browse files
Merge pull request #4843 from syncfusion-content/904710-qb-ddb-corr
904710: Code correction in query builder and drop down button documentation sample.
2 parents f0a0fe6 + fe79a60 commit d745af2

File tree

4 files changed

+37
-58
lines changed

4 files changed

+37
-58
lines changed

blazor/drop-down-menu/popup-items.md

Lines changed: 32 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -151,29 +151,21 @@ You can populate multilevel sub menu items in DropDown menu by using context men
151151
@using Syncfusion.Blazor.SplitButtons
152152
153153
<SfDropDownButton @ref="FileButton" Id="btnFileMenu" Content="File" CssClass="e-dropDown-button">
154-
<ChildContent>
155-
<DropDownButtonEvents OnClose="@DropDownButtonClose"></DropDownButtonEvents>
156-
</ChildContent>
157154
<PopupContent>
158155
<SfContextMenu @ref="ContextMenu" Items="FileMenuItems" TValue="ContextMenuItemModel" ShowItemOnClick="true">
159156
<MenuFieldSettings Text="Content"></MenuFieldSettings>
160-
<MenuEvents TValue="ContextMenuItemModel" OnClose="BeforeClose" Created="OnMenuCreated" ItemSelected="Selected"></MenuEvents>
157+
<MenuEvents TValue="ContextMenuItemModel" OnClose="BeforeClose" Created="OnMenuCreated"></MenuEvents>
161158
</SfContextMenu>
162159
</PopupContent>
163160
</SfDropDownButton>
164161
165162
@code {
166163
SfDropDownButton FileButton;
167164
SfContextMenu<ContextMenuItemModel> ContextMenu;
168-
public bool isClose = false;
169165
170-
private void DropDownButtonClose(BeforeOpenCloseMenuEventArgs args)
171-
{
172-
args.Cancel = true;
173-
}
174166
private void BeforeClose(BeforeOpenCloseMenuEventArgs<ContextMenuItemModel> args)
175167
{
176-
if (!isClose)
168+
if (args.ParentItem == null)
177169
{
178170
FileButton.Toggle();
179171
}
@@ -187,49 +179,37 @@ You can populate multilevel sub menu items in DropDown menu by using context men
187179
public Boolean Separator { get; set; }
188180
}
189181
private List<ContextMenuItemModel> FileMenuItems = new List<ContextMenuItemModel>{
190-
new ContextMenuItemModel {Id ="FileMenuItemsNew", Content = "Align" , Items = new List<ContextMenuItemModel> {
191-
new ContextMenuItemModel { Content="Left" },
192-
new ContextMenuItemModel { Content="Right" },
193-
new ContextMenuItemModel { Content="Center" },
194-
new ContextMenuItemModel { Content="Top"},
195-
new ContextMenuItemModel { Content="Bottom" },
196-
new ContextMenuItemModel { Content="Middle"}
197-
}},
198-
new ContextMenuItemModel {Id ="FileMenuItemsOpen", Content = "Open" },
199-
new ContextMenuItemModel { Separator = true },
200-
new ContextMenuItemModel { Id ="FileMenuItemsSave",Content = "Space", Items = new List<ContextMenuItemModel> {
201-
new ContextMenuItemModel { Content="Double" },
202-
new ContextMenuItemModel { Content="Single" },
203-
new ContextMenuItemModel { Content="Small" },
204-
new ContextMenuItemModel { Content="Big"},
205-
new ContextMenuItemModel { Content="Large" },
206-
}},
207-
new ContextMenuItemModel { Id ="FileMenuItemsSaveAs",Content = "Save As", Items = new List<ContextMenuItemModel> {
208-
new ContextMenuItemModel { Content="PDF" },
209-
new ContextMenuItemModel { Content="Excel" },
210-
new ContextMenuItemModel { Content="Word" },
211-
new ContextMenuItemModel { Content=".XLS"},
212-
} },
213-
new ContextMenuItemModel {Id ="FileMenuItemsExport", Content = "Export"},
214-
new ContextMenuItemModel { Separator = true},
215-
new ContextMenuItemModel { Id ="FileMenuItemsPrint",Content = "Print" }
216-
};
217-
218-
public void OnMenuCreated()
219-
{
220-
ContextMenu.Open();
221-
}
222-
223-
public void Selected(MenuEventArgs<ContextMenuItemModel> args)
182+
new ContextMenuItemModel {Id ="FileMenuItemsNew", Content = "Align" , Items = new List<ContextMenuItemModel> {
183+
new ContextMenuItemModel { Content="Left" },
184+
new ContextMenuItemModel { Content="Right" },
185+
new ContextMenuItemModel { Content="Center" },
186+
new ContextMenuItemModel { Content="Top"},
187+
new ContextMenuItemModel { Content="Bottom" },
188+
new ContextMenuItemModel { Content="Middle"}
189+
}},
190+
new ContextMenuItemModel {Id ="FileMenuItemsOpen", Content = "Open" },
191+
new ContextMenuItemModel { Separator = true },
192+
new ContextMenuItemModel { Id ="FileMenuItemsSave",Content = "Space", Items = new List<ContextMenuItemModel> {
193+
new ContextMenuItemModel { Content="Double" },
194+
new ContextMenuItemModel { Content="Single" },
195+
new ContextMenuItemModel { Content="Small" },
196+
new ContextMenuItemModel { Content="Big"},
197+
new ContextMenuItemModel { Content="Large" },
198+
}},
199+
new ContextMenuItemModel { Id ="FileMenuItemsSaveAs",Content = "Save As", Items = new List<ContextMenuItemModel> {
200+
new ContextMenuItemModel { Content="PDF" },
201+
new ContextMenuItemModel { Content="Excel" },
202+
new ContextMenuItemModel { Content="Word" },
203+
new ContextMenuItemModel { Content=".XLS"},
204+
} },
205+
new ContextMenuItemModel {Id ="FileMenuItemsExport", Content = "Export"},
206+
new ContextMenuItemModel { Separator = true},
207+
new ContextMenuItemModel { Id ="FileMenuItemsPrint",Content = "Print" }
208+
};
209+
210+
public async Task OnMenuCreated()
224211
{
225-
if (args.Item.Content == "Space" || args.Item.Content == "Save As" || args.Item.Content == "Align")
226-
{
227-
isClose = true;
228-
}
229-
else
230-
{
231-
isClose = false;
232-
}
212+
await ContextMenu.OpenAsync();
233213
}
234214
}
235215

blazor/query-builder/columns-binding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ N> You can set `Min` and `Max` values for number values.
169169
@using Syncfusion.Blazor.QueryBuilder
170170
171171
<SfQueryBuilder TValue="EmployeeDetails" AllowValidation="true">
172-
<QueryBuilderColumnValidation Max="0" Min="100"></QueryBuilderColumnValidation>
172+
<QueryBuilderColumnValidation Max="100" Min="0"></QueryBuilderColumnValidation>
173173
<QueryBuilderColumns>
174174
<QueryBuilderColumn Field="EmployeeID" Label="Employee ID" Type="ColumnType.Number"></QueryBuilderColumn>
175175
<QueryBuilderColumn Field="FirstName" Label="First Name" Type="ColumnType.String"></QueryBuilderColumn>

blazor/query-builder/drag-and-drop.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@ The [Blazor Query Builder](https://www.syncfusion.com/blazor-components/blazor-q
3535
SfQueryBuilder<EmployeeDetails> QuerybuilderObj;
3636
List<RuleModel> Rules = new List<RuleModel>()
3737
{
38-
new RuleModel { Label="First Name", Field="FirstName", Type="String", Operator="equal", Value = "Andre", Condition = "and" },
39-
new RuleModel { Label="Last Name", Field="LastName", Type="String", Operator="in", Value = new string[] { "Davolio", "Buchanan" } },
40-
new RuleModel { Label="Last Name", Field="LastName", Type="String", Operator="equal", Value = "Davolio", Condition = "or" },
41-
new RuleModel { Label="Age", Field="Age", Type="Number", Operator="equal", Value = 29, Condition = "and" },
38+
new RuleModel { Label="First Name", Field="FirstName", Type="String", Operator="equal", Value = "Andre" },
39+
new RuleModel { Label="Last Name", Field="LastName", Type="String", Operator="equal", Value = "Davolio" },
40+
new RuleModel { Label="Age", Field="Age", Type="Number", Operator="equal", Value = 29 },
4241
new RuleModel {
4342
Condition = "or", Rules = new List<RuleModel>() {
44-
new RuleModel { Label= "Is Developer", Field = "IsDeveloper", Type = "Boolean", Operator = "equal", Value = true, Condition = "and" },
43+
new RuleModel { Label= "Is Developer", Field = "IsDeveloper", Type = "Boolean", Operator = "equal", Value = true },
4544
new RuleModel { Label= "Primary Framework", Field = "PrimaryFramework", Type = "String", Operator = "equal", Value = "React"}
4645
}
4746
}
-5.24 KB
Loading

0 commit comments

Comments
 (0)