码迷,mamicode.com
首页 > 其他好文 > 详细

yui--datatable 更新table数据

时间:2014-05-24 03:24:45      阅读:323      评论:0      收藏:0      [点我收藏+]

标签:style   class   blog   c   code   java   

更新datasource中_oData数据


bubuko.com,布布扣
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 ="";
                          }
                   }
               }
}
bubuko.com,布布扣

 

刷新表格行


bubuko.com,布布扣
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);
bubuko.com,布布扣

 

yui--datatable 更新table数据,布布扣,bubuko.com

yui--datatable 更新table数据

标签:style   class   blog   c   code   java   

原文地址:http://www.cnblogs.com/wishyouhappy/p/3736687.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!