ext sample


 //加载所有的数据
var alarmInfoDs = new Ext.data.Store({
  proxy : new Ext.data.HttpProxy({url : 'alarmInfo!toAlarmInfoList.action'}),
  reader : new Ext.data.JsonReader({
                totalProperty : 'total',
                root : 'root'
              }, [{name : 'vehicleNo',type : 'string'},
                {name : 'alarmType',type : 'string'},
                {name : 'alarmSpeed',type : 'int'},
                {name : 'alarmDirection',type : 'int'},
                {name : 'vehicleDriver',type : 'string'},
                {name : 'alarmTime',type : 'string'},
                {name : 'alarmLngLat',type : 'string'},
                {name : 'alarmPosition',type : 'string'},
                {name : 'alarmId',type : 'int'},
                {name : 'alarmAccStatus',type : 'int'},
                {name : 'alarmCancel',type : 'int'}
                 ])
});
 var searchalarmInfo = function(){
    alarmInfoDs.load({params : {start : 0,limit : 10}});
};
var alarmReportWin = new Ext.Window({
    title: '报警记录报表',
    modal:true,
    layout:'fit',
    width:900,
    height: 550,
    closeAction:'hide',
    resizable : false,
    plain: true,
    closable : true,
    items: new Ext.grid.GridPanel({
        store: alarmInfoDs,
        hideParent:true,
        stripeRows: true,
        stateful: true,
        tbar:['起始时间:',{
            xtype:'datetimefield',
            emptyText:'请选择日期',
            editable:false,
            format:"Y-m-d H:i",
            width:130
        },'-','结束时间:',{
            xtype:'datetimefield',
            emptyText:'请选择日期',
            format:"Y-m-d H:i",
            width:130
        },'-','报警类型:',{
            xtype:'combo',
            width:100,
            editable: true,
            store: alarmTypeStore,
            displayField:'alarmType',
            valueField: 'alarmType',
            emptyText:'报警类型',
            typeAhead: true,
            mode: 'local',
            triggerAction: 'all',
            selectOnFocus:true
        },'-','车牌号码:',{
            xtype:'combo',
            width:100,
            editable: true,
            store: carStore,
            displayField:'carNum',
            valueField: 'carNum',
            emptyText:'车牌号码',
            typeAhead: true,
            mode: 'local',
            triggerAction: 'all',
            selectOnFocus:true
        },'-',{
            text:'查询',
            iconCls: 'icon-search'
        },'-',{
            text:'导出',
            iconCls: 'icon-excel',
            handler: function() {
                Ext.Ajax.request({
                    url : 'alarmInfo!expAlarmInfoToXls.action',
                    scope : this
                });
            }
        }],
        columns: [
            {header: '车牌号码', width: 100, sortable: true, dataIndex: 'vehicleNo'},
            {header: '报警类型', width: 80, sortable: true, dataIndex: 'alarmType'},
            {header: '速度', width: 60, sortable: true, dataIndex: 'alarmSpeed'},
            {header: '方向', width: 60, sortable: true, dataIndex: 'alarmDirection'},
            {header: '司机', width: 60, sortable: true, dataIndex: 'vehicleDriver'},
            {header: '报警时间', width: 130, sortable: true, dataIndex: 'alarmTime'},
            {header: '经纬度', width: 150, sortable: true, dataIndex: 'alarmLngLat'},
            {header: '地址', width: 250, sortable: true, dataIndex: 'alarmPosition'},
            {header: '主键', width: 130, sortable: true, dataIndex: 'alarmId',hidden:true},
            {header: '报警时开关状态', width: 150, sortable: true, dataIndex: 'alarmAccStatus',hidden:true},
            {header: '是否取消报警', width: 250, sortable: true, dataIndex: 'alarmCancel',hidden:true}
        ],
        bbar: new Ext.PagingToolbar({
            pageSize: 20,
            store: alarmInfoDs,
            displayInfo: true,
            displayMsg: '显示{0} 到 {1} 条记录,共{2} 条记录',
            emptyMsg: "没有记录"
        })
    })
});


//Function


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值