DropDownList Custom DataSource not firing success

2 posts, 0 answers
  1. Monika
    Monika avatar
    1 posts
    Member since:
    Apr 2013

    Posted 17 Nov 2015 Link to this post

    Hi, I am creating a dropdownlist as follows:

    Create Widget:

    html.Kendo().DropDownList().Name(widgetName).DataSource(source =>
                    {
                        source.Custom().Transport(new
                        {
                            read = new Kendo.Mvc.ClientHandlerDescriptor() { HandlerName = "GetPromptData" }
                        });
                    }).HtmlAttributes(new { id = widgetName, selectId = RegexHelper.GetIndex(parameter) })

     GetPromptData:

     

    function GetPromptData(options) {
        $.ajax({
            url: "FileSubmit/GetPromptData",
            datatype: "jsonp",
            data: {
                "selectId": $('#widgetName').attr("selectid"),
                "key": window.dataKey
            },
            contentType: 'application/json',
            success: function (data) {
                alert("Data is received");
                options.success(data);
            }
        });
    }

     And finally my controller:

    public JsonResult GetPromptData(string selectId, string key)
    {
       List<string> items = new List<string>();
       items.Add("item1");
       items.Add("item2");
       return Json(items, JsonRequestBehavior.AllowGet);
    }
      

    The ajax call receives a response but from there nothing happens?

    html.Kendo().DropDownList().Name(normalisedParameter).DataSource(source =>
                    {
                        source.Custom().Transport(new
                        {
                            read = new Kendo.Mvc.ClientHandlerDescriptor() { HandlerName = "GetPromptData" }
                        });
                    }).HtmlAttributes(new { id = normalisedParameter, selectId = RegexHelper.GetIndex(parameter) })
    html.Kendo().DropDownList().Name(normalisedParameter).DataSource(source =>
                    {
                        source.Custom().Transport(new
                        {
                            read = new Kendo.Mvc.ClientHandlerDescriptor() { HandlerName = "GetPromptData" }
                        });
                    }).HtmlAttributes(new { id = normalisedParameter, selectId = RegexHelper.GetIndex(parameter) })
    html.Kendo().DropDownList().Name(normalisedParameter).DataSource(source =>
                    {
                        source.Custom().Transport(new
                        {
                            read = new Kendo.Mvc.ClientHandlerDescriptor() { HandlerName = "GetPromptData" }
                        });
                    }).HtmlAttributes(new { id = normalisedParameter, selectId = RegexHelper.GetIndex(parameter) })
    html.Kendo().DropDownList().Name(normalisedParameter).DataSource(source =>
                    {
                        source.Custom().Transport(new
                        {
                            read = new Kendo.Mvc.ClientHandlerDescriptor() { HandlerName = "GetPromptData" }
                        });
                    }).HtmlAttributes(new { id = normalisedParameter, selectId = RegexHelper.GetIndex(parameter) })
    html.Kendo().DropDownList().Name(normalisedParameter).DataSource(source =>
                    {
                        source.Custom().Transport(new
                        {
                            read = new Kendo.Mvc.ClientHandlerDescriptor() { HandlerName = "GetPromptData" }
                        });
                    }).HtmlAttributes(new { id = normalisedParameter, selectId = RegexHelper.GetIndex(parameter) })
    html.Kendo().DropDownList().Name(normalisedParameter).DataSource(source =>
                    {
                        source.Custom().Transport(new
                        {
                            read = new Kendo.Mvc.ClientHandlerDescriptor() { HandlerName = "GetPromptData" }
                        });
                    }).HtmlAttributes(new { id = normalisedParameter, selectId = RegexHelper.GetIndex(parameter) })
    html.Kendo().DropDownList().Name(normalisedParameter).DataSource(source =>
                    {
                        source.Custom().Transport(new
                        {
                            read = new Kendo.Mvc.ClientHandlerDescriptor() { HandlerName = "GetPromptData" }
                        });
                    }).HtmlAttributes(new { id = normalisedParameter, selectId = RegexHelper.GetIndex(parameter) })
    html.Kendo().DropDownList().Name(normalisedParameter).DataSource(source =>
                    {
                        source.Custom().Transport(new
                        {
                            read = new Kendo.Mvc.ClientHandlerDescriptor() { HandlerName = "GetPromptData" }
                        });
                    }).HtmlAttributes(new { id = normalisedParameter, selectId = RegexHelper.GetIndex(parameter) })
    html.Kendo().DropDownList().Name(normalisedParameter).DataSource(source =>
                    {
                        source.Custom().Transport(new
                        {
                            read = new Kendo.Mvc.ClientHandlerDescriptor() { HandlerName = "GetPromptData" }
                        });
                    }).HtmlAttributes(new { id = normalisedParameter, selectId = RegexHelper.GetIndex(parameter) })
    html.Kendo().DropDownList().Name(normalisedParameter).DataSource(source =>
                    {
                        source.Custom().Transport(new
                        {
                            read = new Kendo.Mvc.ClientHandlerDescriptor() { HandlerName = "GetPromptData" }
                        });
                    }).HtmlAttributes(new { id = normalisedParameter, selectId = RegexHelper.GetIndex(parameter) })
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 19 Nov 2015 Link to this post

    Hello Monika,

    I tried to replicate the issue locally, but to no avail. Check the screencast that I took during my local test: Could you send us a repro demo?

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top