PDA

View Full Version : How to do a post from a button



marxan
27 Sep 2012, 11:30 PM
Hi,

I've created a simple button when clicked it does a window.location to an url with parameters.

I would need to do a post with this parameters as the string can be too long.

Is there a way to do a post with the window location?


Ext.define('TAB.view.ExcelExportButton', { extend: 'Ext.Button',
alias: 'widget.excelbutton',
id: 'exportToExcel',
text: 'Export to Excel',
icon: 'app/view/icons/icon_xls.gif'
});




'button[action = exportToExcel]': {
click: me.toWebQuery
}

toWebQuery: function (){ if (window.location == 'http://localhost:8500/Tab/')
window.open('/tab/app/data/webquery.cfm?indicatorGroup='+Global.indicatorGroup+'&codeListAlreadyLoaded='+Global.codeListAlreadyLoaded+'&countries='+Global.countries+'&years='+Global.years+'&countryCode='+Global.countriesCode+'&countryLabel='+Global.countriesLabel+'&axe='+Global.axe+'&indicatorCode='+Global.indicatorCode+'&indicatorLabel='+Global.indicatorLabel+'&famCompoCode='+Global.famCompoCode+'&famCompoLabel='+Global.famCompoLabel);
}

scottmartin
1 Oct 2012, 6:04 AM
Have a look at:
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.proxy.Ajax-property-actionMethods

Scott.