This is a migrated thread and some comments may be shown as answers.

Dropdownlist select value to datasource

3 Answers 142 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
David Blok
Top achievements
Rank 1
David Blok asked on 21 Sep 2016, 10:11 AM

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"
            }
        }
    });

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 23 Sep 2016, 05:55 AM
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.
 
0
David Blok
Top achievements
Rank 1
answered on 23 Sep 2016, 12:56 PM

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?

 

0
Stefan
Telerik team
answered on 27 Sep 2016, 08:50 AM
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.
 
Tags
DropDownList
Asked by
David Blok
Top achievements
Rank 1
Answers by
Stefan
Telerik team
David Blok
Top achievements
Rank 1
Share this question
or