日期:2014-05-17 浏览次数:20646 次
function addLoadEvent(fn) { if (typeof win.addEventListener != UNDEF) { win.addEventListener("load", fn, false); } else if (typeof doc.addEventListener != UNDEF) { doc.addEventListener("load", fn, false); } else if (typeof win.attachEvent != UNDEF) { addListener(win, "onload", fn); } else if (typeof win.onload == "function") { var fnOld = win.onload; win.onload = function() { fnOld(); fn(); }; } else { win.onload = fn; } }
Ext.onReady(function() { var gridDtl; var myStore = new Ext.data.JsonStore({ autoLoad: true, proxy: new Ext.data.HttpProxy({ url: 'PttGetData.asmx/qryCancelableById', headers: { 'Content-type': 'application/json' } }), baseParams: { id: 'aa' }, root: 'd', fields: ['TermId', 'MsgTime', 'CardId', 'SimNo', 'ShiftSN', 'CmdType', 'CmdMsg', 'IsSucc', 'T_isRec', 'T_IsCommit', 'SendTime', 'RecvTime', 'CommitTime'] }); var grid = new Ext.grid.GridPanel({ store: myStore, columns: [ { header: "信息收发时间", width: 300, renderer: rendeDate, dataIndex: 'MsgTime' }, { header: "终端号", width: 150, dataIndex: 'TermId' }, { header: "车牌号", width: 150, dataIndex: 'CardId' }, { header: "终端sim卡号", width: 200, dataIndex: 'SimNo' }, { header: "作业流水号", width: 200, dataIndex: 'ShiftSN', sortable: true }, { header: "命令类型", width: 150, dataIndex: 'CmdType', sortable: true }, { header: "命令信息内容", width: 200, dataIndex: 'CmdMsg', sortable: true }, { header: "收发是否成功", width: 200, dataIndex: 'IsSucc', sortable: true }, { header: "终端是否收到", width: 200, dataIndex: 'T_isRec', sortable: true }, { header: "终端是否人工确认", width: 200, dataIndex: 'T_IsCommit', sortable: true }, { header: "下发时间", width: 300, renderer: rendeDate, dataIndex: 'SendTime', sortable: true }, { header: "接收时间", width: 300, renderer: rendeDate, dataIndex: 'RecvTime', sortable: true }, { header: "人工确认时间", width: 300, renderer: rendeDate, dataIndex: 'CommitTime', sortable: true } ], viewConfig: { forceFit: true }, width: 1280, height: 250, split: true, buttons: [{ text: '核销', handler: OnCav}], renderTo: 'CAV', frame: true }); function rendeDate(record) { var strDate = "new " + record.substr(1, record.length - 2) return eval("(" + strDate + ")").toLocaleString(); } });