Kendo Refresh (DropDownList.refresh()) not working ERROR Not define

孤街醉人 提交于 2019-12-03 23:28:41
Abhishek

1- Try adding cache: false to disable the cache in Kendo DropDownList's datasource read property:

read: {
    url: <<"url">>,
    cache: false
}

2- Then call read(),

$("#ddl").data("kendoDropDownList").dataSource.read();

It worked for me :)

user1291282

For me just this line did the job:

$("#myDropDownList").data("kendoDropDownList").dataSource.read();

You might find passing parameters to the ".data()" of the dataSource useful.

Example:

var myDataSource={bookId: 10, Name: "Kendo"}
$("#titles").data("kendoDropDownList").dataSource.data(myDataSource);

However, you could also try the cascadingFrom attribute of the DropDownList when you want to update one DropDownList based on the selection of another DropDownList

//Houdini

on your read url add '?myDate=' + new Date(). This will refresh the data. Without it (unless you have meta tags to prevent caching) it will give you that data it has already read.

In my case I commented the line

//cascadeFrom: "dropdown1_id"

on the second kendo dropdown and it worked, for some reason it was messing with the data source updates.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!