Dea*_*ean 10 datasource odata kendo-ui
环境:
数据源:
productsDataSource = new kendo.data.DataSource({
type: "odata",
transport: {
read: "http://www.mydomain.com/odata.svc/products",
dataType: "json",
contentType: "application/json"
}
schema: {
type: "json",
data: function(data){
return data.value;
},
total: function(data){
return data['odata.count'];
},
model: product
},
pageSize: 50,
serverPaging: true,
serverFiltering: true,
serverSorting: true
});
Run Code Online (Sandbox Code Playgroud)获取数据:
productsDataSource.filter([{field:"Id",operator:"eq",value:5}]); //这将发送一个httprequest
productsDataSource.fetch(function(e){tempDataStorage = e.items; //处理数据的更多逻辑;});
问题:
productsDataSource._filter = { logic: 'and', filters: [
{ field: "Id", operator: "eq", value: 5 }]};
Run Code Online (Sandbox Code Playgroud)
我发现这个工作.将内部属性设置为完整的过滤器对象.然后你可以调用fetch.我还没有找到一种方法来改变页面大小而不触发提取.
| 归档时间: |
|
| 查看次数: |
11938 次 |
| 最近记录: |