PriceRightHTML5team
Sep 11, 2014, 9:34 AM
Mine is APS.net MVC razor view engine.
We have partial view with grid having component column. We wanted to render it in container 1st time it renders proper but when we go back to same view it gives attached error. But when we removes component column it works fine.
http://forums.ext.net/attachment.php?attachmentid=15031&stc=1
Code to call partial view
$("#EditWindowContainer").empty();
Ext.net.directRequest({
url: '@Url.Action("ContractingFeed", "PackPayer")',
extraParams: {
containerId: "EditWindowContainer",
packCd: record.data.PACK_CD
},
success: function () { App.WindowContainer.show(); Ext.net.Mask.hide(); setWindowLayoout("ContainerData", 800) }
});
C# Code
return new Ext.Net.MVC.PartialViewResult
{
ViewName = partialViewName,
ContainerId = containerId,
Model = model
};
Grid Sample Code
Html.X().GridPanel().ID("ContractingGridView")
.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("PackPayerSegmentId", ModelFieldType.Int)
, new ModelField("PayerSegmentId", ModelFieldType.Int)
, new ModelField("PACK_CD", ModelFieldType.Int)
, new ModelField("PackPayerSubSegmentId", ModelFieldType.Int)
, new ModelField("PayerSubSegmentId", ModelFieldType.Int)
, new ModelField("PayerSegment", ModelFieldType.String)
, new ModelField("PayerSubSegment", ModelFieldType.String)
, new ModelField("ClassificationType", ModelFieldType.String)
, 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)
, new ModelField("AvgDeductionPercent", ModelFieldType.String)
, new ModelField("ExceptionAllowed", ModelFieldType.String)
, new ModelField("EffectiveDate", ModelFieldType.Date)
, new ModelField("NewEffectiveDateString", ModelFieldType.String)
)
)//.DataSource(Model.PackPayers)
.Proxy(
Html.X().AjaxProxy()
.Url(Url.Action("GetDataContractingFeed"))
.ActionMethods(actions =>
{
actions.Read = HttpMethod.POST;
})
.Reader(Html.X().JsonReader().Root("data"))
.Listeners(l => l.Exception.Handler = "Error()")
)
.Parameters(p =>
{
p.Add(Html.X().StoreParameter().Name("packCd").Mode(ParameterMode.Value).Value(Model.PACK_CD.To String()));
})
.Listeners(li=>li.Load.Handler="if(App.ContractingGridView.store.getAt(0).data.Pac kPayerSegmentId > 0) App.OldEffectiveDate.setValue(App.ContractingGridV iew.store.getAt(0).data.EffectiveDate)")
)
.ColumnModel(
Html.X().Column().Text("Channel").DataIndex("Channel").Flex(2).Renderer("formatCahnnel"),
Html.X().Column().Text("Classification").DataIndex("ClassificationType").Flex(1),
Html.X().Column().Text("Type").DataIndex("AdjustmentType").Flex(1)
, Html.X().ComponentColumn().Text("Channel Weight % *").DataIndex("Weight").Flex(1)
.Editor(true)
.Component(Html.X().NumberField()
.HideTrigger(true).KeyNavEnabled(false).MouseWheel Enabled(false).AllowExponential(false)
).Listeners(li => li.BeforeBind.Handler = "if(e.record.get('PayerSubSegmentId') != '') {return false}")
,
Html.X().ComponentColumn().Text("Max Discount %").DataIndex("MaxDiscountPercent").Flex(1)
.Editor(true)
.Component(Html.X().NumberField()
.HideTrigger(true).KeyNavEnabled(false).MouseWheel Enabled(false).AllowExponential(false)
)
,
Html.X().ComponentColumn().Text("Max Fees** %").DataIndex("MaxFeesPercent").Flex(1)
.Editor(true)
.Component(Html.X().NumberField()
.HideTrigger(true).KeyNavEnabled(false).MouseWheel Enabled(false).AllowExponential(false)
)
,
Html.X().ComponentColumn().Text("AVG Deduction %").DataIndex("AvgDeductionPercent").Flex(1)
.Editor(true)
.Component(Html.X().NumberField()
.HideTrigger(true).KeyNavEnabled(false).MouseWheel Enabled(false).AllowExponential(false)
)
,
Html.X().ComponentColumn().Text("Exceptions Allowed").DataIndex("ExceptionAllowed").Flex(2)
.Editor(true)
.Component(Html.X().TextArea()
).Listeners(li => li.BeforeBind.Handler = "if(e.record.get('PayerSubSegmentId') != '') {e.config[0].hidden = true}")
)
)
We have partial view with grid having component column. We wanted to render it in container 1st time it renders proper but when we go back to same view it gives attached error. But when we removes component column it works fine.
http://forums.ext.net/attachment.php?attachmentid=15031&stc=1
Code to call partial view
$("#EditWindowContainer").empty();
Ext.net.directRequest({
url: '@Url.Action("ContractingFeed", "PackPayer")',
extraParams: {
containerId: "EditWindowContainer",
packCd: record.data.PACK_CD
},
success: function () { App.WindowContainer.show(); Ext.net.Mask.hide(); setWindowLayoout("ContainerData", 800) }
});
C# Code
return new Ext.Net.MVC.PartialViewResult
{
ViewName = partialViewName,
ContainerId = containerId,
Model = model
};
Grid Sample Code
Html.X().GridPanel().ID("ContractingGridView")
.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("PackPayerSegmentId", ModelFieldType.Int)
, new ModelField("PayerSegmentId", ModelFieldType.Int)
, new ModelField("PACK_CD", ModelFieldType.Int)
, new ModelField("PackPayerSubSegmentId", ModelFieldType.Int)
, new ModelField("PayerSubSegmentId", ModelFieldType.Int)
, new ModelField("PayerSegment", ModelFieldType.String)
, new ModelField("PayerSubSegment", ModelFieldType.String)
, new ModelField("ClassificationType", ModelFieldType.String)
, 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)
, new ModelField("AvgDeductionPercent", ModelFieldType.String)
, new ModelField("ExceptionAllowed", ModelFieldType.String)
, new ModelField("EffectiveDate", ModelFieldType.Date)
, new ModelField("NewEffectiveDateString", ModelFieldType.String)
)
)//.DataSource(Model.PackPayers)
.Proxy(
Html.X().AjaxProxy()
.Url(Url.Action("GetDataContractingFeed"))
.ActionMethods(actions =>
{
actions.Read = HttpMethod.POST;
})
.Reader(Html.X().JsonReader().Root("data"))
.Listeners(l => l.Exception.Handler = "Error()")
)
.Parameters(p =>
{
p.Add(Html.X().StoreParameter().Name("packCd").Mode(ParameterMode.Value).Value(Model.PACK_CD.To String()));
})
.Listeners(li=>li.Load.Handler="if(App.ContractingGridView.store.getAt(0).data.Pac kPayerSegmentId > 0) App.OldEffectiveDate.setValue(App.ContractingGridV iew.store.getAt(0).data.EffectiveDate)")
)
.ColumnModel(
Html.X().Column().Text("Channel").DataIndex("Channel").Flex(2).Renderer("formatCahnnel"),
Html.X().Column().Text("Classification").DataIndex("ClassificationType").Flex(1),
Html.X().Column().Text("Type").DataIndex("AdjustmentType").Flex(1)
, Html.X().ComponentColumn().Text("Channel Weight % *").DataIndex("Weight").Flex(1)
.Editor(true)
.Component(Html.X().NumberField()
.HideTrigger(true).KeyNavEnabled(false).MouseWheel Enabled(false).AllowExponential(false)
).Listeners(li => li.BeforeBind.Handler = "if(e.record.get('PayerSubSegmentId') != '') {return false}")
,
Html.X().ComponentColumn().Text("Max Discount %").DataIndex("MaxDiscountPercent").Flex(1)
.Editor(true)
.Component(Html.X().NumberField()
.HideTrigger(true).KeyNavEnabled(false).MouseWheel Enabled(false).AllowExponential(false)
)
,
Html.X().ComponentColumn().Text("Max Fees** %").DataIndex("MaxFeesPercent").Flex(1)
.Editor(true)
.Component(Html.X().NumberField()
.HideTrigger(true).KeyNavEnabled(false).MouseWheel Enabled(false).AllowExponential(false)
)
,
Html.X().ComponentColumn().Text("AVG Deduction %").DataIndex("AvgDeductionPercent").Flex(1)
.Editor(true)
.Component(Html.X().NumberField()
.HideTrigger(true).KeyNavEnabled(false).MouseWheel Enabled(false).AllowExponential(false)
)
,
Html.X().ComponentColumn().Text("Exceptions Allowed").DataIndex("ExceptionAllowed").Flex(2)
.Editor(true)
.Component(Html.X().TextArea()
).Listeners(li => li.BeforeBind.Handler = "if(e.record.get('PayerSubSegmentId') != '') {e.config[0].hidden = true}")
)
)