[CLOSED] JS errors 'getBoundingClientRect'

  1. #1

    [CLOSED] JS errors 'getBoundingClientRect'

    Hi Ext Team,

    Below is the scenario:

    I have a dropdown. Below is the code for the drop down.

    //View

    @(  Html.X().Container().ID("ContainerSection2").Margin(0)//.MinHeight(90)
                        .Items(Html.X().ComboBox().ID("CmbMultiSelection")
                                       .Items(X.ListItem().Text("Select").Value("0"),X.ListItem().Text("Price").Value("1"),
                                       X.ListItem().Text("Revenue").Value("2"))
                                        .SelectedItems(X.ListItem().Value("0"))
                                       .FieldLabel("Multi Select").Select(0)
                                       .Listeners(x => x.Select.Fn = "ChangeMultiSelectionDrp")
                                       ))
    @(  Html.X().Container().ID("ContainerSection4").Margin(0)//.MinHeight(90)
                        .Items(
                                 X.Container().ID("PresentationPartialCntr")))
    //Script

    <script type="text/javascript">
        var ChangeMultiSelectionDrp = function () {
            var selectedValue = App.CmbMultiSelection.getValue();
            var textval;
            if (selectedValue == "2")
                textval = "Revenue";
            else
                textval = "Price";
    
            Ext.net.DirectMethod.request({
                url: '@Url.Action("LoadPartialView", "Home")',
                 json: true,
                 params: {
                     SelectedMetrik: textval                 
                 }
             });
        };
    
    
    </script>
    On changing the value of the drop down to "Price". I call an Partial view to load another drop down. Below is the code:

     public Ext.Net.MVC.PartialViewResult LoadPartialView(string SelectedMetrik)
            {
                ViewModel1 model = new ViewModel1();
    
                List<PresentationCls> list1 = new List<PresentationCls>(); ;
    
                list1.Add(new PresentationCls() { PRESENTATION_CDSTR = "1", PRESENTATION_DESC = "P1" });
                list1.Add(new PresentationCls() { PRESENTATION_CDSTR = "2", PRESENTATION_DESC = "P2" });
                list1.Add(new PresentationCls() { PRESENTATION_CDSTR = "3", PRESENTATION_DESC = "P3" });
                list1.Add(new PresentationCls() { PRESENTATION_CDSTR = "4", PRESENTATION_DESC = "P4" });
    
    
                model.selectedValue = SelectedMetrik;
                model.list = list1;
    
                return new Ext.Net.MVC.PartialViewResult
                {
                    ViewName = "_PartialView",
                    ContainerId = "PresentationPartialCntr",
                    Model = model,
                    ClearContainer = true
                };
            }
    //Partial View

    @model ViewModel1
    
    @if (Model.selectedValue == "Price")
        {
    
     @(Html.X().ComboBoxFor(x => x.list[0].PRESENTATION_CDSTR).ID("CmbPresentation").QueryMode(DataLoadMode.Local).StyleSpec("margin-bottom:5px")
                                     .DisplayField("PRESENTATION_DESC")
                                     .ValueField("PRESENTATION_CDSTR")
                                     .Store
                                         (
                                              Html.X().Store().ID("StorePresentation")
                                              .Model(
                                                      Html.X().Model()
                                                      .Fields(new ModelField("PRESENTATION_DESC"),
                                                              new ModelField("PRESENTATION_CDSTR"))
                                                    )
                                              .DataSource(Model.list)
                                         )
                                     .FieldLabel("Presentation")
                                     .LabelCls("fieldLabelTop")                                 
    
             )
    }
    else if (Model.selectedValue == "Revenue")
        {
            @(
             Html.X().Container().ID("ContainerSection90").Margin(0)
                  .Items(
                Html.X().MultiCombo().FieldLabel("Presentations :")
                    .ID("CmbPresentation").LabelCls("fieldLabelTop")
                    .QueryMode(DataLoadMode.Local)
                    
                    .ForceSelection(true)
                    //.ListConfig(Html.X().BoundList().Listeners(events => events.ItemClick.Handler = "SelectPresentation(record)"))
                    .DisplayField("PRESENTATION_DESC")
                    .ValueField("PRESENTATION_CDSTR")
                    .EmptyText("Please Select")
                    .Store
                                        (
                                                Html.X().Store().ID("StoreMultiPrCombo")
                                                 .Model(Html.X().Model()
                                                         .Fields(
                                                                 new ModelField("PRESENTATION_DESC"),
                                                                 new ModelField("PRESENTATION_CDSTR")
                                                                )
                                                        )
                                                 .DataSource(Model.list)
                                        )// Multi select Presentation Combobox,
              
                                       )
    
             )
        }
    //Model for the Partial View

     public class PresentationCls
        {
            public string PRESENTATION_DESC { get; set; }
            public string PRESENTATION_CDSTR { get; set; }        
        }
        public class ViewModel1
        {
            public string selectedValue { get; set; }
            public List<PresentationCls> list { get; set; }
        }
    Below are the steps to generate the error:
    1) Once the page runs we select "Price" from the 1st dropdown.Second dropdown loads from the partial view
    2) Then we select "P2" from second dropdown.
    3) We then select "Revenue" from 1st dropdown. And we get the JS Error.

    Ideally it should load the multiselect dropdown.

    Can you please let me know whats causing this error .Also this is only for IE browser.

    Let me know if u have any questions

    Thanks
    1)
    Last edited by Daniil; Jan 16, 2014 at 6:12 AM. Reason: [CLOSED]
  2. #2
    Hi @PriceRightHTML5team,

    I cannot reproduce with the latest Ext.NET + IE9. What are yours?
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @PriceRightHTML5team,

    I cannot reproduce with the latest Ext.NET + IE9. What are yours?
    I have Ext v2.2 and IE 11.
  4. #4
    Please try this:
    ...
    return new Ext.Net.MVC.PartialViewResult
    {
        ViewName = "_PartialView",
        ContainerId = "PresentationPartialCntr",
        Model = model,
        RenderMode = Ext.Net.RenderMode.AddTo
    };
    and
    App.PresentationPartialCntr.removeAll();
    Ext.net.DirectMethod.request({ ... });
  5. #5
    Quote Originally Posted by Daniil View Post
    Please try this:
    ...
    return new Ext.Net.MVC.PartialViewResult
    {
        ViewName = "_PartialView",
        ContainerId = "PresentationPartialCntr",
        Model = model,
        RenderMode = Ext.Net.RenderMode.AddTo
    };
    and
    App.PresentationPartialCntr.removeAll();
    Ext.net.DirectMethod.request({ ... });
    The above solution worked.Now i am not getting the error

Similar Threads

  1. [CLOSED] Ext.Net JS errors from controls
    By PriceRightHTML5team in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 22, 2013, 3:59 PM
  2. [CLOSED] Field Errors help
    By jpadgett in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Aug 19, 2013, 3:08 PM
  3. Errors upgrading from Ext.Net 1.0 to 2.0
    By yash.kapoor in forum 2.x Help
    Replies: 2
    Last Post: Nov 08, 2012, 3:10 AM
  4. Replies: 4
    Last Post: Nov 05, 2011, 6:17 AM
  5. Publish Errors
    By Juls in forum 1.x Help
    Replies: 2
    Last Post: Jun 16, 2009, 2:54 PM

Posting Permissions