var tableid;
$(function(){
			$('#table').datagrid({
				title:'车辆窗口',
				iconCls:'icon-ico_car_nor',
				width:1197,
				height:240,
				nowrap: false,
				striped: true,
				remoteSort: false,
				resizeHandle: 'right',
				align:'center',
				idField:'carId',
				fixed:true,
				rownumbers:true,
				singleSelect:true,
				multiSort:false,
				fitColumns:false,
				columns:[[
				    {field:'carId',title:'车牌号',width:30,hidden:true},
					{field:'vhcCode',title:'车牌号码',width:120},
					{field:'recvtime',title:'服务器时间',width:130},
					{field:'gpstime',title:'GPS时间',width:130},
					{field:'state2',title:'状态',width:50},
					{field:'direct',title:'方向',width:50},
					{field:'speed',title:'速度',width:30},
					{field:'oilMN1',title:'油量',width:30},
					{field:'temp1',title:'温度1',width:50},
					{field:'temp2',title:'温度2',width:50},
					{field:'temp3',title:'温度3',width:50},
					{field:'temp4',title:'温度4',width:50},
					{field:'totalDistance',title:'总里程',width:50},
					{field:'lng',title:'纬度',width:70},
					{field:'lat',title:'经度',width:70},
					{field:'memo',title:'位置',width:200}
				]],
				onDblClickRow:function(rowIndex, rowData){
				    map.toCenter(rowData.lng,rowData.lat,map.getZoom());
				    $("#vehName").text(rowData.vhcCode);
				    $("#vhcid").val(rowData.carId);
				    $("#vehicle").val(rowData.vhcCode);
				},
				onSelect:function(rowIndex, rowData){
				    tableid=rowData.carId;
				}
				
			});
});

