Javascript 剑道UI网格,添加列和列总和值

Javascript 剑道UI网格,添加列和列总和值,javascript,datasource,kendo-grid,Javascript,Datasource,Kendo Grid,我正在使用剑道网格工具。 我有一个包含值的数据源​​在一个对象中存在另一个对象。就像两个数组,一个在另一个里面 $("#PedidoConsolidadoGrid").kendoGrid({ dataSource: { data: mData, schema: { model: { // define the model of the data source. Required for validation and property

我正在使用剑道网格工具。 我有一个包含值的数据源​​在一个对象中存在另一个对象。就像两个数组,一个在另一个里面

$("#PedidoConsolidadoGrid").kendoGrid({
    dataSource: {
        data: mData,
        schema: {
            model: { // define the model of the data source. Required for validation and property types.
                id: "CodigoArticulo",
                fields: {
                    //CodigoPedido: { editable: false },
                    CodigoArticulo: { editable: false },
                    FechaPedido: { editable: false },
                    CantidadExistencias: { editable: false },
                    DescripcionArticulo: { editable: false },
                    CantidadConsolidar: {
                        editable: true, 
                        type: "number", 
                        validation: { required: true, min: 0, max: 9999 },
                    },
                }
            }
        },
        pageSize: 11
    },
    scrollable: true,
    pageable: true,
    editable: {
        mode: "inline", // mode can be incell/inline/popup with Q1 '12 Beta Release of Kendo UI
        confirmation: false // the confirmation message for destroy command
    }, // enable editing
    selectable: "single",
    pageable: {
        numeric: true,
        previousNext: true,
        refresh: true,
        buttonCount: 5,
        messages: {
            display: "Mostrando {0}-{1} de {2}",
            empty: "No hay datos para mostrar",
            page: "Enter page",
            of: "de {0}",
            itemsPerPage: "Pedidos por página",
            first: "Primera página",
            last: "Última página",
            next: "Siguiente",
            previous: "Anterior",
            refresh: "Refrescar"
        }
     },
     columns: [
         //{ field: "CodigoPedido", title: "Código del Pedido", width: "150px" },
         { field: "CodigoArticulo", title: mData[0].CodigoArticulo , width: "150px" },
         { field: "DescripcionArticulo", title: "Articulo", width: "200px" },
         { field: "FechaPedido", title: "Fecha Pedido", width: "150px", template: '#= kendo.toString( toDate(FechaPedido), "dd/MM/yyyy" ) #' },
         { field: "CantidadConsolidar", title: "Total Pedido", width: "120px", },
         { field: "CantidadExistencias", title: "Total Existencia", width: "120px" },
         { command: "edit", text: "Editar"}
     ],
});
如何将数组中的数据创建到另一个数组中的列?
以及如何对列求和并在网格的另一列中显示总计。

您可能应该检查计算属性,在这种情况下,CantidadConsolidar可能是一个计算字段

dataSource = new kendo.data.DataSource({
data: [
  { first: "John", last: "Doe" }, 
  { first: "Jane", last: "Doe" }
],
schema: {
  model: {
    // Calculated field
    fullName: function() {
      return this.get("first") + " " + this.get("last");
    }
    fields:{
        ...
    },
  }
}
}))

此外,选中此项可显示网格中某一列的值之和