我需要刷新自动填充小部件的数据源(网址)。
factor = tipoSeleccionado.factor;
$cptconcepto.kendoAutoComplete({
minLength: 1,
filter: "contains",
dataTextField: "descripcion",
dataValueField: "idTipoMovimiento",
dataSource: {
type: "get",
serverFiltering: true,
transport: {
read: {
url: pathservicehost + '/movimientos/tipos/' + factor,
dataType: "json",
cache: false
}
}
},
index: 0
});
"因子"是一个不断改变其价值的变量。
答案 0 :(得分:0)
这很简单。只需在read.url
属性中使用函数而不是字符串:
url: function() {
return pathservicehost + '/movimientos/tipos/' + factor;
}
Demo。在演示中,检查开发工具中的网络选项卡,并查看当您更改自动完成值时,网址随当前时间戳更改。