Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @class SWP.view.swpTabPanel.ExportFormDownloadButton This is ExportFormDownloadButton class.
- * It is Split button. This is used to download xpt file.
- * It is extended from the Ext.button.Split.
- * This is attached to export form.
- * @extends Ext.button.Split
- * @alias widget.downloadButton
- */
- var eWin = 0;
- Ext.define('SWP.view.swpTabPanel.ExportFormDownloadButton', {
- extend: 'Ext.button.Split',
- alias : 'widget.downloadButton',
- constructor:function(config){
- var me = this;
- me.setMenu(new Ext.menu.Menu({
- items: config.items,
- listeners:{
- /**
- * @event click
- * This Click event is fired when click on split button.
- * @param {Ext.button.Button} menu
- * @param {object} item
- * @param {object} e
- */
- click:function(menu, item, e, eOpts)
- {
- var me = this;
- var expDetails = me.up('form').down('dynamicformpanel').formVal.FORMS;
- var form = me.up('form');
- if(item.name == "dnXpt")
- {
- item.EXPSSDID = me.up('downloadButton').EXPSSDID;
- }
- if(item.name == "dnXpt" || menu == "dnXpt")
- {
- var expObj = {
- "iCrpId" : expDetails.CORPID,
- "iPrjId" :expDetails.PROJID ,
- "iStrtID": expDetails.STRUCTID,
- "iElemID" : expDetails.ELEMID,
- "iSSDID" : item.EXPSSDID,
- "iFileId" : expDetails.FILEID,
- "iFlg" : 2,
- "iSolId" : solId,
- "iFUID" : form.FUID,
- "iOutType" : 0,
- "iNetworkPath" : 0,
- "iCache" : 0
- };
- var expXml = [];
- SWP.util.Utility.objectToElement('R', SWP.util.Utility.parseObjKeysXML(expObj), expXml);
- expXml.pop();
- expXml.pop();
- expXml.pop();
- expXml.push('</R>');
- PC.Ajax.request({
- url : config.btnUrl ,
- method : 'POST',
- me:me,
- headers:{
- "Accept":"application/json; charset=utf-8"
- },
- disableCaching: false,
- params:{
- 'strIPXML' : expXml.join('')
- },
- success : function (response) {
- var data = Ext.decode( response.responseText),processId=0,status=-1;
- if( data.R ){
- processId = data.R.Processid;
- var strIPXML= expXml.join('');
- url = filepath.COMMON_REFRESH + "CrpID="+expDetails.CORPID+"&PrjID="+expDetails.PROJID+"&AppID=64&Flg=22&ProcessID=" + processId + "&ReportType=7";
- me.Exportdata(url, "Study");
- }
- }
- });
- }
- }
- },
- /**
- * This method is to show the exported data processing until export is completed by passing
- * specific url and message.
- * @param {url} url
- * @param {string} headerMsg
- */
- Exportdata : function (url, headerMsg) {
- var me= this;
- var window = Ext.create('Ext.window.Window',{
- title : headerMsg,
- width : 350,
- me:me,
- height : 250,
- layout : 'fit',
- plain : true,
- id : 'exportWin' + (++eWin),
- buttonAlign : 'center',
- items : [{
- xtype : 'box',
- autoEl : {
- tag : 'iframe',
- src : url,
- id : eWin,
- name : 'ExportFrame',
- height : '100%',
- width : '100%',
- style : 'cursor:pointer;top:10px'
- }
- }
- ]
- });
- $( "window.#button2" ).click(function() {
- alert( "Handler for .click() called." );
- });
- window.show();
- }
- }));
- this.callParent( arguments);
- }
- });
Add Comment
Please, Sign In to add comment