Sep 11, 2014, 4:32 PM
[CLOSED] GridPanel ComponentColumn in partial view giving 'me undefined error '
HI,
Mine is an ASP.net MVC razor view engine application.
I have a partial view in which i have a grid panel.
The grid panel has a component column.
Following are the snippets of model, controller and views to reproduce the issue.
Index Dummy view
Test Partial View
Issue :
Following are the steps to reproduce the issue
1. Expand menu
2. Click on Test Data link. This will load view having component column gird panel.
3. Click on Test 1 link
Observe. Getting below error
Mine is an ASP.net MVC razor view engine application.
I have a partial view in which i have a grid panel.
The grid panel has a component column.
Following are the snippets of model, controller and views to reproduce the issue.
public class PackPayerDTO
{
public string Channel { get; set; }
public decimal? MaxFeesPercent { get; set; }
public decimal? MaxDiscountPercent { get; set; }
public List<PackPayerDTO> PackPayers { get; set; }
}
public class PackPayerController
{
public ActionResult IndexDummy()
{
return View("IndexDummy");
}
public ActionResult test(string containerId)
{
PackPayerDTO packPayer = new PackPayerDTO();
packPayer.PackPayers = new List<PackPayerDTO>();
packPayer.PackPayers.Add(new PackPayerDTO { Channel = "Channel 1", MaxFeesPercent = 20, MaxDiscountPercent = 90 });
packPayer.PackPayers.Add(new PackPayerDTO { Channel = "Channel 2", MaxFeesPercent = 20, MaxDiscountPercent = 90 });
packPayer.PackPayers.Add(new PackPayerDTO { Channel = "Channel 3", MaxFeesPercent = 20, MaxDiscountPercent = 90 });
packPayer.PackPayers.Add(new PackPayerDTO { Channel = "Channel 4", MaxFeesPercent = 20, MaxDiscountPercent = 90 });
return new Ext.Net.MVC.PartialViewResult
{
ViewName = "_test",
ContainerId = containerId,
ClearContainer = true,
Model = packPayer,
RenderMode = RenderMode.AddTo
};
}
public ActionResult test1(string containerId)
{
return new Ext.Net.MVC.PartialViewResult
{
ViewName = "_test1",
ContainerId = containerId,
ClearContainer = true,
RenderMode = RenderMode.AddTo
};
}
}
Index Dummy view
@{
ViewBag.Title = "Admin Home";
var X = Html.X();
}
<script> var Navigation = function (action, controller) {
var url = '@Url.Action("action", "controller")';
url = url.replace("action", action);
url = url.replace("controller", controller);
Ext.net.Mask.show();
Ext.net.directRequest({
timeout: 7000000,
url: url,
extraParams: { ContainerId: "ChildContentContainer" },
success: function () { Ext.net.Mask.hide(); $(".main-content").animate({ scrollTop: 0 }, "slow"); },
failure: function () { Ext.net.Mask.hide(); }
});
};</script>
@Html.X().ResourceManager().CleanResourceUrl(false)
@(Html.X().Container().ID("ContainerAdminHome").Cls("twelve columns")
.Items(
Html.X().Panel().ID("pnlAdminMenu").Title("MasterMenu")
.Cls("three columns")
.Collapsible(true).CollapseDirection(Direction.Left).Border(true).TitleCollapse(true)
.StyleSpec("padding:0px 5px 0px 0px !important; min-height:400px !important")
.BodyStyle("border:none !important").OverflowY(Overflow.Hidden)
.Region(Ext.Net.Region.West)
.Margins("5 0 5 0")
.Border(false)
.Items(panelitems =>
{
panelitems.Add(Html.X().MenuPanel().Collapsible(true).TitleCollapse(true)
.CollapseDirection(Direction.Top)
.Collapsed(true)
.Height(100)
.Menu(menu =>
{
menu.Items.Add(Html.X().MenuItem().Text("Test Data").IconCls("v-menu-bulletstyle").Handler("Navigation('test','PackPayer');"));
menu.Items.Add(Html.X().MenuItem().Text("Test 1").IconCls("v-menu-bulletstyle").Handler("Navigation('test1','PackPayer');"));
}));
})
,
Html.X().Container().ID("ChildContentContainer")
.Cls("nine columns")
.StyleSpec("width:97% ")
//.DirectEvents(de =>
//{
// de.Render.Url = Url.Action("Index", "UserManage");
// de.Render.ExtraParams.Add(new { ContainerId = "ChildContentContainer" });
//})
)
)
Test Partial View
@model PackPayerDTO
@(Html.X().Panel().Title("US Contracting Feed Management").BodyPadding(5)
.Items(
Html.X().GridPanel()
.Border(true)
.SortableColumns(false)
.EnableColumnHide(false)
.Scroll(ScrollMode.Horizontal)
.Store(Html.X().Store().PageSize(50)
.SortOnFilter(false).SortOnLoad(false)
.Model(Html.X().Model()
.Fields(
new ModelField("Channel", ModelFieldType.String)
, new ModelField("AdjustmentType", ModelFieldType.String)
, new ModelField("Weight", ModelFieldType.String)
, new ModelField("MaxFeesPercent", ModelFieldType.String)
, new ModelField("MaxDiscountPercent", ModelFieldType.String)
)
).DataSource(Model.PackPayers)
)
.ColumnModel(
Html.X().Column().Text("Channel").DataIndex("Channel").Flex(2),
Html.X().ComponentColumn().Text("Channel Weight % *")
.DataIndex("Weight").Flex(1)
.Editor(true)
.Component(Html.X().NumberField()
.HideTrigger(true).KeyNavEnabled(false).MouseWheelEnabled(false).AllowExponential(false)
)
)
)
)
Test 1 partial view@(Html.X().DisplayField().Text("This is another partial view"))
Issue :
Following are the steps to reproduce the issue
1. Expand menu
2. Click on Test Data link. This will load view having component column gird panel.
3. Click on Test 1 link
Observe. Getting below error
Last edited by Daniil; Sep 19, 2014 at 10:13 AM.
Reason: [CLOSED]