我正在使用 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”
谢谢
一个