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

  1. #1

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

    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.




    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.ToString()));
                                                                            })
                                                                .Listeners(li=>li.Load.Handler="if(App.ContractingGridView.store.getAt(0).data.PackPayerSegmentId > 0) App.OldEffectiveDate.setValue(App.ContractingGridView.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).MouseWheelEnabled(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).MouseWheelEnabled(false).AllowExponential(false)
                                                                                                                        )
                                                                                                              ,
                                                                                    Html.X().ComponentColumn().Text("Max Fees** %").DataIndex("MaxFeesPercent").Flex(1)
                                                                                                              .Editor(true)
                                                                                                              .Component(Html.X().NumberField()
                                                                                                                                 .HideTrigger(true).KeyNavEnabled(false).MouseWheelEnabled(false).AllowExponential(false)
                                                                                                               )
                                                                                                              ,
                                                                                    Html.X().ComponentColumn().Text("AVG Deduction %").DataIndex("AvgDeductionPercent").Flex(1)
                                                                                                              .Editor(true)
                                                                                                              .Component(Html.X().NumberField()
                                                                                                                                 .HideTrigger(true).KeyNavEnabled(false).MouseWheelEnabled(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}")
    
                                                                                           )
                                                  )
    Attached Thumbnails Click image for larger version. 

Name:	Me.jpg 
Views:	80 
Size:	104.0 KB 
ID:	15031  
    Last edited by Daniil; Sep 19, 2014 at 10:18 AM. Reason: [CLOSED]
  2. #2
    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.
    Last edited by Daniil; Sep 11, 2014 at 4:48 PM.
  3. #3
    Issue not resolved.

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

    I guess that the issue is already fixed in SVN
    Please update from SVN and retest
  5. #5
    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.
  6. #6
    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.
  7. #7
    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.
  8. #8
    I think the last and the previous revisions on the ComponentColumn.js are actual for you.

Similar Threads

  1. MVC: Clear a partial view from a container
    By bright in forum 2.x Help
    Replies: 0
    Last Post: Jun 12, 2014, 7:06 AM
  2. [MVC] How to use a partial view in a window?
    By KBorkiewicz in forum 2.x Help
    Replies: 7
    Last Post: Nov 21, 2012, 11:11 PM
  3. [CLOSED] Modal Partial view Window
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: May 19, 2011, 5:26 PM
  4. [CLOSED] MVC- How to display a Partial View from a window
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 08, 2011, 11:32 AM
  5. [CLOSED] remote sort gird use anthor column
    By lonely7345 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 11, 2011, 1:26 AM

Posting Permissions