0

帮我修复这个两天前运行完美的代码。我不知道我改变了什么,但现在,网格只是空的,你能帮我吗?请。

$("#grid").kendoGrid({
       sortable: true,
       groupable: true,
       scrollable: true,
       height: "300px",
       pageable: {
         pageSizes: 9
                 },
       dataSource: {
         transport: {
             read: {
                url: "http://localhost/pharmacypoints/api/Productos/getSinFiltro",
                    dataType: "Json"
                              }
             }
                },
    Columns:  [
              { field: "Codigo",
                tittle: "Codigo"
              }, 
      { field: "Descripcion", 
        tittle: "Descripcion" 
      }, 
      { field: "Familia", 
        tittle: "Familia"
      }, 
      { field: "Laboratorio",
        title: "Laboratorio"
      }, 
      { field: "Clasificacion",
        tittle: "Clasificacion"
      }]

                        });

数据库结果是这样的:

[{"Codigo":"6140","Producto":"CIPROXINA FA 200ML 400MG","Familia":"ANTIBIOTICO 10","Clasificacion":"CONTROLADOS","Laboratorio":"BAYER DE MEXICO, SA DE CV"}, and more objects
4

1 回答 1

2

两个小问题:

  1. Columns必须是小写。
  2. 它是title和不是tittle

尝试这个:

$("#grid").kendoGrid({
    sortable  : true,
    groupable : true,
    scrollable: true,
    height    : "300px",
    pageable  : {
        pageSizes: 9
    },
    dataSource: {
        transport: {
            read: {
                url     : "http://localhost/pharmacypoints/api/Productos/getSinFiltro",
                dataType: "Json"
            }
        }
    },
    columns   : [
        { field: "Codigo", title: "Codigo" },
        { field: "Descripcion", title: "Descripcion" },
        { field: "Familia", title: "Familia" },
        { field: "Laboratorio", title: "Laboratorio" },
        { field: "Clasificacion", title: "Clasificacion" }
    ]
});
于 2013-04-10T23:06:03.570 回答