Kendo Dropdown list

Not sure why the select event doesn't work (doesn't fire off function onSelect)
I suspect the schema piece it messing things up

function onSelect(e) {
            var dataItem = this.dataItem(e.item);
            alert(dataItem.value);
            
        }

        $("#ddlvcenter").kendoDropDownList({
            filter: "startswith",
            dataTextField: "Server",
            dataValueField: "Server",
            dataSource: {
                transport: {
                    read: {
                        url: "VDRService.asmx/VCenterDashBoardDDL",
                        contentType: "application/json; charset=utf-8",
                        type: "POST"
                    }
                },
                select: onSelect,
                schema: {
                    data: function (result) {
                        var myData = result.d;
                        var obj = JSON.parse(myData);
                        var objnoroot = obj.Table;
                        var myData = JSON.stringify(objnoroot);
                        return eval(myData);
                    }
                }
            }
        }).data('kendoDropDownList');

Open in new window

Please help!
LVL 4
Mauro CazabonnetSenior Software EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Any errors in the console?

Select with id=ddlvcenter exists?

The setup of the select: onSelect seems fine - tests out ok in (http://dojo.telerik.com/ access from here http://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist)

I suspect you have a Javascript error on your page that is causing the script to fail before getting that far.

Check your console for errors on page load and after select.
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mauro CazabonnetSenior Software EngineerAuthor Commented:
Thx for the assist.
I didn't implement the schema
I ran with this

function onvCenterSelect(e) {
        var dataItem = this.dataItem(e.item);
        loadESXHostsDDL(dataItem.Value);       
    }

    $("#ddlvcenter").kendoDropDownList({
        filter: "startswith",
        dataTextField: "Server",
        dataValueField: "Value",
        select: onvCenterSelect        
    }).data('kendoDropDownList');

    $.ajax({
        type: "POST",
        url: "VDRService.asmx/VCenterDashBoardDDL",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (result) {
            var myData = result.d;
            var obj = JSON.parse(myData);
            var objnoroot = obj.Table;
            //var myData = JSON.stringify(objnoroot);
            var ddl = $('#ddlvcenter').data("kendoDropDownList");
            ddl.setDataSource(objnoroot);
            ddl.refresh();
            var dataItem = ddl.dataItem();
            loadESXHostsDDL(dataItem.Value);
        }
    });

Open in new window


Thx again
0
Julian HansenCommented:
You are welcome.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.