【问题标题】:Why does kendo-grid using Razor not have OData为什么使用 Razor 的 kendo-grid 没有 OData
【发布时间】:2015-07-02 13:01:59
【问题描述】:

我有一个使用远程绑定到旧 WCF 服务的剑道网格。我制作了一些新的 OData 服务,但当我切换时,我对 OData 不是属性感到困惑。

旧代码:

    $(document).ready(function() {
        $("#grid").kendoGrid({
            dataSource: {
                type: "odata", // <-- This property exist
                transport: {
                    read: {
                        url: "http://localhost:49168/MyDataService.svc/Products",
                        data: { $expand: "Department,Editorial"}                            
                    }
                },

不起作用的新代码

@(Html.Kendo().Grid<Product>()
    .Name("grid")
    .DataSource(dataSource => dataSource
        .OData() // <-- This property does not exist but I would think it should
        .Model(model => model.Id(c => c.Id))
                        .Read(read => read.Url("http://localhost:52706/odata/ProductsData"))
    )
    .Columns(columns =>
    {

【问题讨论】:

    标签: c# asp.net-mvc razor kendo-grid


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-07
      • 2016-10-24
      • 2020-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-18
      • 1970-01-01
      相关资源
      最近更新 更多