May 04, 2016, 7:35 PM
How To: Add Context Menu to GridPanel
Hello Guys,
In Example explorer, I did not find any MVC example that demonstrate Context Menu in GridPanel.
Since I am using vb.net language, so far I have added this GridPanel.
Like I want to add three labels in context menu, and each will have its onclick event which will open three different popups.
Can anyone help me proceed further?
In Example explorer, I did not find any MVC example that demonstrate Context Menu in GridPanel.
Since I am using vb.net language, so far I have added this GridPanel.
@(Html.X().GridPanel() _
.Title("Editable GridPanel") _
.Width(600) _
.Height(350) _
.Store(Html.X().Store() _
.ID("Store1") _
.Model(Html.X().Model() _
.IDProperty("ID") _
.Fields(
New ModelField("ID", ModelFieldType.Int),
New ModelField("Name"),
New ModelField("Price", ModelFieldType.Float),
New ModelField("Change", ModelFieldType.Float),
New ModelField("PctChange", ModelFieldType.Float),
New ModelField("LastChange", ModelFieldType.Date)
)
) _
.DataSource(Model)
) _
.ColumnModel(
Html.X().Column().Text("ID").DataIndex("ID").Width(35),
Html.X().Column() _
.Text("Name") _
.DataIndex("Name") _
.Flex(1) _
.Editor(Html.X().TextField()),
Html.X().Column() _
.Text("Price") _
.DataIndex("Price") _
.Renderer(RendererFormat.UsMoney) _
.Editor(Html.X().NumberField()),
Html.X().Column() _
.Text("Change") _
.DataIndex("Change") _
.Renderer("change") _
.Editor(Html.X().NumberField()),
Html.X().Column() _
.Text("PctChange") _
.DataIndex("PctChange") _
.Renderer("pctChange") _
.Editor(Html.X().NumberField()),
Html.X().DateColumn() _
.Text("Last Updated") _
.DataIndex("LastChange") _
.Format("MM-dd-yyyy") _
.Editor(Html.X().DateField().Format("MM-dd-yyyy"))
) _
.SelectionModel(Html.X().CellSelectionModel()) _
.Plugins(
Html.X().CellEditing().Listeners(Function(ls) ls.Edit.Fn = "edit")
) _
.Listeners(Function(ls) ls.RowContextMenu.Handler = "")
)
and here you can see I am trying to add RowContextMenu in listerners, but I am not able to move further. How to add items, and attach function to that item.Like I want to add three labels in context menu, and each will have its onclick event which will open three different popups.
Can anyone help me proceed further?