Some code about kendo dropdown list in my javascript is making Chrome go "Aw Snap!"

58 views Asked by At

I am calling the function below when dataBound gets fired for one of the kendo drop down list. Something here is making chrome go Aw Snap. I checked developer's tools and the console doesn't report any error. Please advise.

alterBuildingClass:function(e)
{
    var ddl = $('#PropertyDetails_bldgClass').data("kendoDropDownList"),
        ddlOptions = ddl.dataSource.data();

    var futureDate = new Date('6/1/2017');
    var poldate = new Date(window["PropertyDetails_MainGroup_ViewModel"].dc.Policy[0].polEffectiveDate);
    
    if(poldate.getDate() >= futureDate.getDate())
    {
        for(var i = 0; i < ddlOptions.length; i++)
        {
            if(ddlOptions[i].DisplayValue === "Multiple Occupancies: 5 to 10 units - Other - 10012" || ddlOptions[i].DisplayValue === "Multiple Occupancies: 11-30 units - Other - 10016")
                ddl.dataSource.remove(ddlOptions[i]);
            if(ddlOptions[i].DisplayValue === "Multiple Occupancies: 11-30 units -  Apt., Office, Service -  (Rate Groups 2-6) - 10014")
                ddlOptions[i].DisplayValue = "Multiple Occupancies: 11-30 units -  Apt., Office, Retail, Service -  (Rate Groups 2-6) - 10014";
            if(ddlOptions[i].DisplayValue === "Multiple Occupancies: 5 to 10 units -  Apt., Office, Service -  (Rate Groups 2-6) - 10010")
                ddlOptions[i].DisplayValue = "Multiple Occupancies: Up to 10 units -  Apt., Office, Retail, Service -  (Rate Groups 2-6) - 10010";
            ddl.refresh();
        }
    }
}

0

There are 0 answers