我使用的是 Kendo-UI,在这个框架中我们可以使用 ODATA、JSON-P、JSON 读取数据。我们使用(json_encode())成功开发了 JSON-P 和 PHP 中的 JSON 数据。但我们无法使用 PHP 创建 ODATA。
我们应该使用 PHP 将编码数据制作为 ODATA 格式。请看一下我们需要这个的代码。请往下看。
{field: "Status", title: "Status", width: "150px", editor: function(container, options) {
$('<input data-text-field="Name" data-value-field="Id" data-bind="value:' + options.field + '"/>').appendTo(container).kendoComboBox({
index: 0,
dataTextField: "Name",
dataValueField: "Id",
filter: "contains",
dataSource: {
type: "odata",
serverFiltering: true,
serverPaging: true,
pageSize: 20,
transport: {
read: "http://odata.netflix.com/Catalog/Titles"
}
}
});
}
},
是否有任何想法将数据编码为这种样式“http://odata.netflix.com/Catalog/Titles?$format=json&$inlinecount=allpages&$callback=callback&$top=20”
Thanks
A