Я работаю с инструментом Kendo Grid. У меня есть источник данных, который содержит значения объекта и в этом объекте существует еще один. Это как два массива, один внутри другого.Kendo UI Grid, Добавить значения столбцов и столбцов
$("#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"}
],
});
Как создать столбцы для данных, находящихся в массиве, в другой массив? и как суммировать столбцы и отображать общее количество в другом столбце сетки.