首页 > 代码库 > yui--datatable 更新table数据
yui--datatable 更新table数据
更新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 = http://www.mamicode.com/records[k]._oData;>if(alarmDispose(alarmStatus)){ oData.ALARMSTATUS =getAlarmStatusFromCode(alarmStatus); }else{ oData.ALARMSTATUS =""; } } } }
刷新表格行
var recordsSet = myTable.getRecordSet(); var records = recordsSet.getRecords(); var table_oData= http://www.mamicode.com/new Array(); for(var x=0; x<records.length; x++){ var oData = http://www.mamicode.com/records[x]._oData;> oData; } myTable.updateRows(0,table_oData);
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。