Jan 14, 2014, 11:09 AM
[CLOSED] JS errors 'getBoundingClientRect'
Hi Ext Team,
Below is the scenario:
I have a dropdown. Below is the code for the drop down.
//View
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)
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]