PDA

View Full Version : [CLOSED] me undefined while rerendering partial view having gird with Component column in Container or Window



PriceRightHTML5team
Sep 11, 2014, 8: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}")

)
)

Daniil
Sep 11, 2014, 4:33 PM
Hi @PriceRightHTML5team,

Please try to set

RenderMode = RenderMode.AddTo
for the PartialViewResult instance.

Also I don't think you should use this

$("#EditWindowContainer").empty();

It doesn't destroy instances of Ext.NET components (the instances of JavaScript classes). With RenderMode.AddTo you could call.

App.EditWindowContainer.removeAll();

As for a JavaScript error, we think that it is due to the bug that has been already fixed in SVN trunk.

PriceRightHTML5team
Sep 11, 2014, 5:31 PM
Issue not resolved.

I have given one runnable test case on http://forums.ext.net/showthread.php?43271 to avoid confusion.

Vladimir
Sep 11, 2014, 6:49 PM
Hi

I guess that the issue is already fixed in SVN
Please update from SVN and retest

PriceRightHTML5team
Sep 12, 2014, 7:57 AM
Hi,

We already have application with Ext.Net.dll of version 2.2.0.26551. New Ext.Net.dll might affect the application.

So please provide respective script changes.

Thanks.

Daniil
Sep 12, 2014, 9:56 AM
Please do "Show Log" for the ComponentColumn.js file. You will probably see a related SVN revision and will be able to extract the required changes.

PriceRightHTML5team
Sep 12, 2014, 11:00 AM
Hi Daniil,

We have being going through the log for quite a long time. Unfortunately we are not able to get the specific SVN check in.

Could you please provide us the specific fix.

Thanks.

Daniil
Sep 12, 2014, 4:49 PM
I think the last and the previous revisions on the ComponentColumn.js are actual for you.