| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- Ext.QuickTips.init();
- Ext.define('erp.controller.common.MoreSubs', {
- extend : 'Ext.app.Controller',
- requires : ['erp.util.BaseUtil', 'erp.util.FormUtil', 'erp.util.RenderUtil'],
- views : ['common.DeskTop.MoreSubs', 'common.datalist.GridPanel',
- 'common.datalist.Toolbar', 'core.grid.TfColumn',
- 'core.grid.YnColumn','core.grid.HeaderFilter','common.DeskTop.DeskTabPanel'],
- init : function() {
- var me = this;
- this.BaseUtil = Ext.create('erp.util.BaseUtil');
- this.FormUtil = Ext.create('erp.util.FormUtil');
- this.GridUtil = Ext.create('erp.util.GridUtil');
- this.control({
- 'erpDatalistGridPanel' : {
- itemclick: this.onGridItemClick
- }
- });
- },
- onGridItemClick: function(selModel, record){
- this.showWin(record.data.num_id_,record.data.instance_id_,record.data.id_,record.data.title_,'Subs');
- },
- showWin :function (numId,mainId,insId,title,id){
- var me=this;
- var url='common/charts/mobileCharts.action?numId='+numId+'&mainId='+mainId+'&insId='+insId+'&title='+title;
- if (Ext.getCmp('chwin')) {
- Ext.getCmp('chwin').setTitle(title);
- Ext.getCmp('chwin').insId=insId;
- Ext.getCmp('chwin').body.update('<iframe id="iframech" src="'+basePath+url+'" height="100%" width="100%" frameborder="0" scrolling="auto" ></iframe>');
- }
- else {
- var chwin = new Ext.window.Window({
- id : 'chwin',
- title: title,
- height: "100%",
- width: "80%",
- insId:insId,
- resizable:false,
- modal:true,
- buttonAlign : 'center',
- layout : 'anchor',
- items: [{
- tag : 'iframe',
- frame : true,
- anchor : '100% 100%',
- layout : 'fit',
- html : '<iframe id="iframech" src="'+basePath+url+'" height="100%" width="100%" frameborder="0" scrolling="auto" ></iframe>'
- }],
- buttons : [{
- text : '上一条',
- cls: 'x-btn-gray',
- handler : function(btn){
- me.prev(btn,id,btn.ownerCt.ownerCt.insId);
- }
- },{
- text : '下一条',
- cls: 'x-btn-gray',
- handler : function(btn){
- me.next(btn,id,btn.ownerCt.ownerCt.insId);
- }
- },{
- text : '关 闭',
- iconCls: 'x-button-icon-close',
- cls: 'x-btn-gray',
- handler : function(){
- Ext.getCmp('chwin').close();
- }
- }]
- });
- chwin.show();}},
- prev:function(btn,tabId,insId,index){
- //递归查找下一条,并取到数据
- var grid=Ext.getCmp(tabId);
- var record =index?grid.store.getAt(index):grid.store.findRecord('id_', insId, 0, false, false, true);
- var fIndex=index||record.index;
- if(fIndex-1 >=0){
- var d = grid.store.getAt(fIndex - 1);
- if(d){
- if(d.data['id_']==insId){
- this.prev(btn,tabId,insId,d.index);//过滤因合计数据重复显示的记录
- }
- else {this.showWin(d.data['num_id_'],d.data['instance_id_'],d.data['id_'],d.data['title_'],tabId);}
- }}
- else alert('暂无上一条数据');//btn.setDisabled(true);
- },
- next:function(btn,tabId,insId,index){
- //递归查找下一条,并取到数据
- var grid=Ext.getCmp(tabId);
- var record =index?grid.store.getAt(index):grid.store.findRecord('id_', insId, 0, false, false, true);
- var fIndex=index||record.index;
- if(fIndex+1 < grid.store.data.items.length){
- var d = grid.store.getAt(fIndex + 1);
- if(d){
- if(d.data['id_']==insId){
- this.next(btn,tabId,insId,d.index);
- }
- else {this.showWin(d.data['num_id_'],d.data['instance_id_'],d.data['id_'],d.data['title_'],tabId);}
- }}
- else alert('暂无下一条数据');//btn.setDisabled(true);
- }
- });
|