Dropdownlist Select Event not recognized

2 posts, 1 answers
  1. Tim
    Tim avatar
    5 posts
    Member since:
    Sep 2011

    Posted 23 Apr 2013 Link to this post

    Hi there,

    I am continuing to eval the kendo grid for purchase and seeing if I can get it working in my application which is using MVC 4 and kendo 2013.1.319. 

    While swapping in the dropdown I am running into an error for only certain records where the Select Event function on the dropdown is not recognized; even though it is present in the javascript. Its weird because it works for most records that visit the details page and once in awhile it breaks and I can't figure out why. Any ideas?

    For example:

    I am binding this list with a selectlist in the controller and the values are properly set. there is a full list and the Id is there in the list.

    //select list on the viewmodel
    pvModel.CostCenterList = new SelectList(_setupBiz.GetNonOverheadCostCenters(), "Key", "Value",pvModel.CostCenterId);

    I have this DDL on the .cshtml page

                            .OptionLabel("Pick a costcenter...")

    and this script in my <scripts> section

        function CostCenterSelect(e) {       
            var costCenter = this.dataItem(e.item.index());
            if (costCenter.Value > 0) {
    //stuff happens
            else {
    //hide a bunch of buttons        }

  2. Answer
    Tim avatar
    5 posts
    Member since:
    Sep 2011

    Posted 24 Apr 2013 Link to this post

    It turns out there was a bad character in one of the standard input fields on the page. I think this broke Javascript and the dropdown was the first item on the page so when it tried to fire the event it didn't work.

    This issue has been resolved.
Back to Top