$.ajax({
type: "OST",
url: "/bookroom/getBookRoomListByCheckId.do",
data: "checkId="+"20000",
dataType:"json",
success: function(msg){
// create CollectionView on the data (to get events)
if(msg.success){
var bookRoomview = new wijmo.collections.CollectionView(msg.attributes.list);
var grid = new wijmo.grid.FlexGrid('#div_bookRoom', {
autoGenerateColumns: false,
allowMerging : wijmo.grid.AllowMerging.All,
isReadOnly : false,
selectionMode : wijmo.grid.SelectionMode.Row,
allowAddNew:true,
columns: [
{ header: '序号', width:50,isReadOnly:true},
{ header: '房类',binding:"roomtypeId",width:'*' },
{ header: '订房数', binding:"bookNum",width:'*' },
{ header: '留房数', binding:"saveNum",isReadOnly:true,width:'*'},
{ header: '抵店日期',binding:"reachDate", width:'*'},
{ header: '离店日期',binding:"leaveDate", width:'*'},
{ header: '抵店时间', width:'*'},
{ header: '房价',binding:"roomPrice", width:'*'},
{ header: '抵达数',binding:"reachNum", width:'*'},
{ header: '操作', width:'*',isReadOnly:true},
],
itemsSource: bookRoomview,
});
var col = grid.columns.getColumn('roomtypeId');
col.dataMap = new wijmo.grid.DataMap(msg.attributes.roomTypeList, 'codeId', 'codeNamec');
$("#insert").click(function(){
console.info(bookRoomview.itemsAdded); //此处获取不到新添加的数据项
console.info(bookRoomview.itemsEdited); //次数获取不到编辑过的数据项
});
}
}
});
麻烦您看下,哪里出错了! |
|