日期:2014-05-16 浏览次数:20905 次
.......
<script type="text/javascript" src="sm.js"></script>
<script type="text/javascript" >
var arr = new Array();
function ReadCommData(){
var info = document.getElementById("MyComm").ReadComm(1,0); //从串口读取数据
var temp = info.split("|"); //分离
arr = new Array(temp); //转换成arrayReader需要的格式
}
</script>
.........
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = '../extjs/resources/images/default/s.gif';
var cm = new Ext.grid.ColumnModel({
{header:'ZL',dataIndex:'zl'},
{header:'CD',dataIndex:'code'},
{header:'FCT',dataIndex:'fct'}
})
var store = new Ext.data.Store({
proxy: new Ext.data.MemoryProxy(arr),
reader: new Ext.data.ArrayReader({}, [
{name: 'zl,'},
{name: 'code'},
{name: 'fct'}
])
});
store.load();
var grid = new Ext.grid.Grid({
renderTo: 'grid',
store: store,
cm: cm
});
})