更新datasource中_oData数据
var myTable = Map.realYUIDataTable;
var recordsSet = myTable.getRecordSet();
var records = recordsSet.getRecords();for(var i=0; i<results.length; i++){
vehicleid = results[i].VEHICLEID;
speed = results[i].SPEED;
gpsTime = results[i].GPSTIME;
longitude = results[i].LONGITUDE;
latitude = results[i].LATITUDE;
alarmStatus = results[i].ALARMSTATUS;
onlineState = results[i].ISONLINE;for(var k=0; k<records.length; k++){
var oData = records[k]._oData;if(vehicleid == oData.VEHICLEID){
oData.SPEED =speed;
oData.GPSTIME =gpsTime;
oData.LONGTITUDE =longitude;
oData.LATITUDE =latitude;
oData.ONLINESTATUS =isOnline(onlineState);if(alarmDispose(alarmStatus)){
oData.ALARMSTATUS =getAlarmStatusFromCode(alarmStatus);
}else{
oData.ALARMSTATUS ="";
}
}
}
}
刷新表格行
var recordsSet = myTable.getRecordSet();
var records = recordsSet.getRecords();var table_oData= new Array();
for(var x=0; x<records.length; x++){
var oData = records[x]._oData;
table_oData[x] = oData;
}
myTable.updateRows(0,table_oData);
yui--datatable 更新table数据,布布扣,bubuko.com