Wenn ich versuche, die Rasterdatensätze in den untergeordneten Rasterfeldern hinzuzufügen oder zu aktualisieren, wird das Raster aktualisiert, nicht jedoch die Rasterdatenquelle.Ich habe versucht, die Rasterdatenquelle aus der Ansicht abzurufen das hat auch nicht die aktualisierten Daten. ein und sein ein anderes Objekt ohne refence zu Eltern-Datenquelle kann mir bitte sagen, was mit dem folgenden Code falschKendo-Rasterdatenquelle wird beim Hinzufügen oder Bearbeiten von Datensätzen in untergeordneten Gittern nicht aktualisiert
<div id="Grid"></div>
<script type="text/javascript">
var data = [{
"BUCode": 6,
"BUCodeName": "PrinterPix.com",
"ClientCode": 1,
"CreatedByCode": 1,
"CreatedByName": "Bangalore Team",
"DisplayCode": null,
"IsActive": false,
"ParentProductCode": 115,
"ParentboProductCode": 115,
"WorkCenterCode": 20,
"WorkCenterName": "Print",
"listRoutingPlanActivity": [{
"ActivityCode": 12,
"ActivityDisplayCode": null,
"ActivityName": "Cut",
"IsActive": false,
"MachineHours": 0,
"MachineSetupHours": 0,
"StandardMinutes": 0,
"WorkCenterCode": 20,
"SequenceNumber": 1,
"listActivityMaterial": [{
"ActivityCode": 12,
"Code": 0,
"ActivityName": "Cut",
"BUCode": 6,
"BUCodeName": "PrinterPix.com",
"ChildProductCode": 0,
"ChildboProductCode": null,
"ClientCode": 1,
"CreatedByCode": 0,
"IsActive": false,
"ParentProductCode": 0,
"ParentboProductCode": null,
"ChildCategoryCode": 128,
"ChildCategoryName": "_Raw Materials_",
"ParentCategoryCode": 0,
"ParentCategoryName": "",
"Quantity": 0,
"WorkCenterCode": 20
}],
"Code": 0,
"OutputProductCode": 0,
"OutPutBoProduct": ""
}]
}, {
"BUCode": 6,
"BUCodeName": "PrinterPix.com",
"ClientCode": 1,
"CreatedByCode": 1,
"CreatedByName": "Bangalore Team",
"DisplayCode": null,
"IsActive": false,
"ParentProductCode": 115,
"ParentboProductCode": 115,
"WorkCenterCode": 23,
"WorkCenterName": "Streatch",
"listRoutingPlanActivity": [{
"ActivityCode": 15,
"ActivityDisplayCode": null,
"ActivityName": "Stretched",
"IsActive": false,
"MachineHours": 0,
"MachineSetupHours": 0,
"StandardMinutes": 0,
"WorkCenterCode": 23,
"SequenceNumber": 2,
"listActivityMaterial": [{
"ActivityCode": 15,
"Code": 0,
"ActivityName": "Stretched",
"BUCode": 6,
"BUCodeName": "PrinterPix.com",
"ChildProductCode": 0,
"ChildboProductCode": null,
"ClientCode": 1,
"CreatedByCode": 0,
"IsActive": false,
"ParentProductCode": 0,
"ParentboProductCode": null,
"ChildCategoryCode": 128,
"ChildCategoryName": "_Raw Materials_",
"ParentCategoryCode": 0,
"ParentCategoryName": "",
"Quantity": 0,
"WorkCenterCode": 23
}],
"Code": 0,
"OutputProductCode": 0,
"OutPutBoProduct": ""
}]
}, {
"BUCode": 6,
"BUCodeName": "PrinterPix.com",
"ClientCode": 1,
"CreatedByCode": 1,
"CreatedByName": "Bangalore Team",
"DisplayCode": null,
"IsActive": false,
"ParentProductCode": 115,
"ParentboProductCode": 115,
"WorkCenterCode": 34,
"WorkCenterName": "Sticking",
"listRoutingPlanActivity": [{
"ActivityCode": 66,
"ActivityDisplayCode": null,
"ActivityName": "Sticking",
"IsActive": false,
"MachineHours": 0,
"MachineSetupHours": 0,
"StandardMinutes": 0,
"WorkCenterCode": 34,
"SequenceNumber": 3,
"listActivityMaterial": [{
"ActivityCode": 66,
"Code": 0,
"ActivityName": "Sticking",
"BUCode": 6,
"BUCodeName": "PrinterPix.com",
"ChildProductCode": 0,
"ChildboProductCode": null,
"ClientCode": 1,
"CreatedByCode": 0,
"IsActive": false,
"ParentProductCode": 0,
"ParentboProductCode": null,
"ChildCategoryCode": 128,
"ChildCategoryName": "_Raw Materials_",
"ParentCategoryCode": 0,
"ParentCategoryName": "",
"Quantity": 0,
"WorkCenterCode": 34
}],
"Code": 0,
"OutputProductCode": 0,
"OutPutBoProduct": ""
}]
}];
var gridDataSource = new kendo.data.DataSource({
transport: {
read: function(options) {
options.success(data);
}
},
schema: {
model: {
id: "WorkCenterCode",
fields: {
WorkCenterCode: {
editable: false
},
WorkCenterName: {
editable: false,
}
}
}
},
});
$("#Grid").kendoGrid({
autoBind:true,
dataSource: gridDataSource,
sortable: false,
pageable: false,
scrollable: true,
// detailInit: secondGridInit,
columns: [{
field: "WorkCenterName",
title: "Work Center Name"
}]
})
});
function secondGridInit(e) {
console.log(JSON.stringify(e.data.listRoutingPlanActivity));
var findByID = function(id) {
return e.data.listRoutingPlanActivity.find(function(item) {
return item.ActivityCode == id;
});
};
$("<div id='activity' class='activity'/>").appendTo(e.detailCell).kendoGrid({
dataSource: {
transport: {
read: function(options) {
options.success(e.data.listRoutingPlanActivity.toJSON());
},
update: function(options) {
e.data.dirty = true;
options.success();
},
},
schema: {
model: {
id: "ActivityCode",
fields: {
WorkCenterCode: {
editable: false
},
ActivityCode: {
editable: false
},
ActivityName: {
editable: false
},
IsActive: {
editable: false,
defaultValue: true
},
StandardMinutes: {
type: "number"
},
MachineSetupHours: {
type: "number"
},
MachineHours: {
type: "number"
},
}
}
}
},
scrollable: true,
editable: "popup",
columns: [{
field: "ActivityName",
title: "Activity"
}, {
field: "StandardMinutes",
title: "Standard Time"
}, {
field: "MachineSetupHours",
title: "Machine Setup Time"
}, {
field: "MachineHours",
title: "Machine Hours"
}, {
command: "edit"
},
]
}
</script>
Können Sie mir sagen, welches Ereignis ist am besten, diesen Code zu behandeln? – Nadendla
Ich habe es auf eine Dropdown-Option außerhalb der Fakultät getan, können Sie nach Bedarf oder auf DataBound-Ereignis, wie DataBound: setTimeout (configureGridProperties, oder dataBound: function() {setTimeout (configureGridProperties, 1);}, – Rajdeep