Dropdownlist select value to datasource

4 posts, 0 answers
  1. David Blok
    David Blok avatar
    42 posts
    Member since:
    Nov 2009

    Posted 21 Sep Link to this post

    Hi,

    I'm trying to change the datasource value on change api of the dropdownlist.
    Anyone have suggestion?

    Code:

    $("#ddllanguage").kendoDropDownList({
            ...
            change: DropdownChange
        });
     
    var dropdownlist = $("#ddllanguage").data("kendoDropDownList");
     
    function DropdownChange() {
            $("#technicalspecs").data("kendoListView").dataSource.read(); // RELOAD DATASOURCE ON KENDOLISTVIEW
        };
     
    var dataSourcetechnical = new kendo.data.DataSource({
            transport: {
                read: {
                    url: "/api/someurl",
                    data: { languageid: dropdownlist.value() }, //HOW TO CHANGE THIS VALUE ON CHANGE EVENT
                    dataType: "json"
                }
            }
        });

  2. Stefan
    Admin
    Stefan avatar
    264 posts

    Posted 23 Sep Link to this post

    Hello David,

    I can suggest using the schema.parse property of the Kendo UI DataSource to modified the response from the server:

    http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.parse

    I hope this will help you to achieve the desired result.

    Regards,
    Stefan
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  3. Kendo UI is VS 2017 Ready
  4. David Blok
    David Blok avatar
    42 posts
    Member since:
    Nov 2009

    Posted 23 Sep in reply to Stefan Link to this post

    Hi,

    Thanks for the reply. But i'm not don't fully understand the example.

    How do i change the transport Data with parse after DropdownChange?

     

  5. Stefan
    Admin
    Stefan avatar
    264 posts

    Posted 27 Sep Link to this post

    Hello David,

    The schema.parse is allowing to change the received data from the dataSource.

    If the desired result is to change the data on the server, this can be achieved using the data method of the DataSource:

    http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#methods-data

    If both are not applicable in your scenario could you please share with me more information about the desired result.

    Regards,
    Stefan
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
Back to Top
Kendo UI is VS 2017 Ready