DHTML(table,row,cell)

                                  <div style="height:147px; overflow:auto">
                                        <table id="tblBoxAlarm" width="100%" border="0" cellpadding="1" cellspacing="1" style="background-color:#bdd3ef;">
                                            <tr style="height:20px; background-color:#eff7ff">
                                                <td style="width:80px;" align="left">箱号</td>
                                                <td style="width:220px;" align="left">报警内容</td>
                                                <td style="width:120px;" align="left">报警时间</td>
                                            </tr>
                                        </table>
                                  </div>

            var ds = response.value;
            var table,row,cell;
            table = document.getElementById("tblBoxAlarm");
            var j = table.rows.length - 1;
            for(var i=j; i>0; i--)
            {
                table.deleteRow(i);
            }
            for(var i=0;i<ds.Tables[0].Rows.length;i++)
            {
               alarmTime=ds.Tables[0].Rows[i].TIME_STR;
               alarm=ds.Tables[0].Rows[i].CONTENT;
               boxNo=ds.Tables[0].Rows[i].LIC_NO;
               alarmId=ds.Tables[0].Rows[i].ID;
  
              alarmDetail = (alarm.length > 16 ? (alarm.substr(0,15)+"...") : alarm);
               row = table.insertRow();
                row.style.backgroundColor = "#ffffff";
                row.style.height = "20";
                row.title = alarm;                   
                row.οnmοuseοver=function (){this.style.backgroundColor="#ffff78";};
                row.οnmοuseοut=function (){this.style.backgroundColor="#ffffff";};

  cell = row.insertCell();
                cell.style.width = "80";
                cell.style.align = "left";
                cell.innerHTML = "<a href='javascript:ShowBoxAlarmDetail(" + alarmId + ");'>" + boxNo + "</a>";

                cell = row.insertCell();
                cell.style.width = "220";
                cell.align = "center";
                cell.innerText = alarmDetail;
                cell = row.insertCell();
                cell.style.width = "100";
                cell.align = "left";
                cell.innerText = alarmTime;
 }

=================================================================================================
         <div style="width:550px; height:148px; overflow:auto;">
                                                <table id="tblHistoryTrack" width="530px" border="0" cellpadding="1" cellspacing="1" style="background-color:#bdd3ef;">
                                                    <tr style="height:20px; background-color:#eff7ff">
                                                        <td style="width:30px;" align="left">序号</td>
                                                        <td style="width:120px" align="left">时间</td>
                                                        <td style="width:40px;" align="left">速度</td>
                                                        <td style="width:40px;" align="left">方向</td>
                                                        <td style="width:30px;" align="left">报警</td>
                                                        <td align="left">位置</td>
                                                        <td style="display:none">经度</td>
                                                        <td style="display:none">纬度</td>
                                                    </tr>
                                                </table>
                                            </div>


                var table = document.getElementById("tblHistoryTrack");
                var row,cell;
                row = table.insertRow(1);
                row.style.backgroundColor = "#ffffff";
                row.style.height = "20";
                row.title="先[暂停],再点选本表时间,可定点回放";
                cell = row.insertCell();
                cell.style.width = "30";
                cell.style.align = "left";
                cell.innerText = g_historyTrackPlayCounter.toString();
                cell = row.insertCell();
                cell.style.width = "120";
                cell.align = "left";
                //cell.innerText = locationTime;
                cell.innerHTML = "<a href=\"javascript:ShowCurrentPosition('" +g_historyTrackPlayCounter.toString()+"','"+locationTime+"','"+speed+"','"+longitude+"','"+latitude+"','"+direction+"','"+directionName + "');\">" + locationTime + "</a>";
               
                cell = row.insertCell();
                cell.style.width = "40";
                cell.align = "center";
                cell.innerText = speed;
                cell = row.insertCell();
                cell.style.width = "40";
                cell.align = "center";
                cell.innerText = directionName;
                cell = row.insertCell();
                cell.style.width = "30";
                cell.align = "center";
                if(isAlarm=="Y")
                {
                  cell.style.backgroundColor="#ff0000";
                  row.title="本轨迹点有报警信息,可点选报警栏查看.";
                  var index = document.getElementById("selVehicles2").selectedIndex;
                  var vid = document.getElementById("selVehicles2").options[index].value;
                  var boxNo=document.getElementById("selVehicles2").options[index].text;
                  boxNo=boxNo.substr(boxNo.indexOf('(')+1);
                  boxNo=boxNo.substr(0,boxNo.length-1);
                  cell.innerHTML ="<a href=\"javascript:ShowCurrentAlarm('"+locationTime+"',"+ vid +",'"+ boxNo +"');\">&nbsp;&nbsp;" + isAlarm + "&nbsp;&nbsp;</a>";
                }
                else
                {
  cell.innerText = isAlarm;
              
                 }
                cell = row.insertCell();
                cell.style.width = "250";
                cell.align = "left";
                cell.innerText = location;
              

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值