Apr 13, 2022, 7:35 PM
Getting the Id of the selected row in the Grid with the Button in my Mvc Project and routing
X.Panel()
.ID("South")
.Region(Region.South)
.Title("Hasta Listesi")
.Frame(true)
.Height(375)
.Collapsible(true)
.Layout(LayoutType.Form)
.ItemsFromPage(this, "~/Views/Istatistik/AltListe.cshtml")
AltList.cshtml I want to get the Id of the selected row in the Grid panel in Partial View and process it. I'm new to Mvc Ext.net, can you please help.
Html.X().GridPanel()
.ID("PersonelGrid")
.Width(1520)
.Height(300)
.SelectionModel(X.RowSelectionModel().Mode(SelectionMode.Single).ID("RowSelectionModel1").SelectedIndex(0))
.ForceFit(true).Store(Html.X().Store()
.DataSource(Model)
.ID("Store1")
.Model(Html.X().Model()
.Fields(
new ModelField("Id"),
new ModelField("Adi"),
new ModelField("Soyadi"),
new ModelField("Tel"),
new ModelField("Mail"),
new ModelField("Sehir"),
new ModelField("Departman"),
new ModelField("Aciklama"),
new ModelField("Aktif", ModelFieldType.Boolean)
)))
.ColumnModel(
X.Column().Text("Id").DataIndex("Id").Hidden(true),
X.Column().Text("Adi").DataIndex("Adi"),
X.Column().Text("Soyadi").DataIndex("Soyadi"),
X.Column().Text("Tel").DataIndex("Tel"),
X.Column().Text("Mail").DataIndex("Mail"),
X.Column().Text("Sehir").DataIndex("Sehir"),
X.Column().Text("Departman").DataIndex("Departman"),
X.Column().Text("Aciklama").DataIndex("Aciklama")
)
.BottomBar(Html.X().PagingToolbar().StoreID("Store1").HideRefresh(false)
.Items(X.Toolbar().Items(
X.Button()
.Text("Tüm Listeyi Yazd?r")
.IconCls("add32")
.Icon(Icon.Printer)
.Region(Region.East)
)))
)
------------------------------------------Index.cshtmlI want to get the id of the selected row with the button on the panel.
X.Panel()
.Title("Hasta ??lemleri")
.Frame(true)
.Padding(0)
.Height(300)
.Width(100)
.Items(X.Toolbar()
.Layout(LayoutType.Column)
.Items(
X.Button().Scale(ButtonScale.Large)
.Text("Muayene Ba?lat")
.IconCls("add32")
.IconUrl("/Content/images/muayene_32.png")
.IconAlign(IconAlign.Top)
.Height(60)
.Width(100)
.DirectEvents
(de =>
{
de.Click.Action = "Submit";
de.Click.EventMask.ShowMask = true;
de.Click.ExtraParams.Add(new Parameter()
{
Name = "selection",
Value = "App.PersonelGrid.getSelectionSubmit().getSelectionModelField().getValue()",
Mode = ParameterMode.Raw
});
}
)
I'm new to Mvc.Ext.net. Can you please help me on how to do it. I have reviewed the relevant examples. but I could not reach the result. "App.PersonelGrid.getSelectionSubmit().getSelectio nModelField().getValue()", I can get the index of the selected row with this method. But I could not get the id of the relevant row. thanks
Last edited by alioksuzoglu; Apr 16, 2022 at 9:03 AM.