參考CollectionViewIntro的範例,知道tcEditedGrid利用cvTrackingChanges 來紀錄編修後的新值,
(function () {
var cvTrackingChanges = new wijmo.collections.CollectionView(getData(6)),
tcMainGrid = new wijmo.grid.FlexGrid('#tcMainGrid'), // the flexGrid to edit the data
tcEditedGrid = new wijmo.grid.FlexGrid('#tcEditedGrid'), // the flexGrid to record the edited items
tcAddedGrid = new wijmo.grid.FlexGrid('#tcAddedGrid'), // the flexGrid to record the added items
tcRemovedGrid = new wijmo.grid.FlexGrid('#tcRemovedGrid'), // the flexGrid to record the removed items
columnsDefinition = [
{ header: 'employee_id', binding: 'employee_id' },
{ header: 'employee_id', binding: 'cname' },
{ header: 'ename', binding: 'ename' },
{ header: 'email', binding: 'email' },
{ header: 'phone_number', binding: 'phone_number' }
];
// initialize the grids
tcMainGrid.initialize({
allowAddNew: true,
allowDelete: true,
itemsSource: cvTrackingChanges
});
tcEditedGrid.initialize({
isReadOnly: true,
autoGenerateColumns: false,
columns: columnsDefinition,
itemsSource: cvTrackingChanges.itemsEdited
});
...
我的疑問是要如何從tcEditedGrid取出修改後的資料內容回後台? |