Apr 24, 2013, 1:26 PM
[CLOSED] How to create Ext.net grid panel dynamically at client side
Hi,
I have been using ext.net Mvc + razor in my application. Can you please provide code sample for grid panel creation at client side.
I need to add listeners and load store data using ajax calls. For example..... following is the code for grid with razor syntax. Almost same kind of grid I want to create at client side dynamically.
I have been using ext.net Mvc + razor in my application. Can you please provide code sample for grid panel creation at client side.
I need to add listeners and load store data using ajax calls. For example..... following is the code for grid with razor syntax. Almost same kind of grid I want to create at client side dynamically.
@(Html.X().GridPanel()
.ID("grdBusinessUnits")
.Cls("grd-existing-goals")
.Border(false)
.Height(280)
.Width(210)
.SelectionMemory(false)
.Store(Html.X().Store().ID("BusinessUnitsStore").Listeners(ls => ls.Load.Fn = "SelectBusinessUnits")
.AutoLoad(false)
.Model(Html.X().Model().ID("BusinessUnitsModel")
.IDProperty("Org_Level_Id")
.Fields(
new ModelField("Org_Level_Id", ModelFieldType.Int) { Mapping = "Org_Level_Id" },
new ModelField("Org_Level_Desc", ModelFieldType.String) { Mapping = "Org_Level_Desc" }
)
)
.Proxy(Html.X().AjaxProxy()
.Url(Url.Action("GetBusinessUnits"))
.Reader(Html.X().JsonReader().Root("data"))
)
.Parameters(
ps => ps.Add(new StoreParameter("regionCSV", "App.hdnRegionIds.value", ParameterMode.Raw))
)
).EmptyText("No records found. Please select a region to see related business units")
.ColumnModel(
Html.X().Column().Text(Resource.Talent.LinkedHierarchies.BusinessUnitsText).Width(160).DataIndex("Org_Level_Desc")
)
.SelectionModel(Html.X().CheckboxSelectionModel().ID("chkBusinessUnitsSelect")
.Mode(SelectionMode.Multi)
.SelectedRecordID("Org_Level_Id")
.CheckOnly(true)
.Listeners(ls =>
{
ls.Select.Handler = "if (!this.selectLock){ BusinessUnitSelect(this,record,index); }";
ls.Deselect.Handler = " if (!this.deselectLock){ BusinessUnitDeselect(); }";
}
)
)
)
Last edited by Daniil; Apr 26, 2013 at 5:38 AM.
Reason: [CLOSED]