PDA

View Full Version : How to pass a store through an URL



marxan
9 Feb 2011, 12:57 AM
Hi,

Is it possible to pass a JsonStore that I'm using in a GridPanel in an url? I want to reuse these datas to generate an Excel file in coldfusion.


listData = Ext.extend(Ext.grid.GridPanel, {
border:false,
initComponent:function() {
var store = new Ext.data.JsonStore({
totalProperty: 'DATASET',
root: 'ROWS',
url: '../components/JSONMonitoring.cfc',
baseParams:
{
method: 'GetProjectDetail',
returnFormat: 'JSON',
},
reader: ProjectReader,
fields:[
'ID_REQUEST',
'TYPE_DEST',
'CHEF_DE_FILE',
'UNIT',
'ASSISTANT',
'DAYS_LEFT',
'DEADLINE'
]
});

var config = {
store: store,
autoHeight: true,
title: '',
loadMask: true,
tbar:[
{
xtype:'tbbutton',
text: 'Export to Excel',
handler: function(){
window.open('../../cf/GUI/toExcel.cfm?store=store');
}
}
],

Thanks,

Marxan

Graveworm
9 Feb 2011, 2:42 AM
Maybe you can try it with:


(...)
var encodedStore = Ext.encode(store);
window.open('../../cf/GUI/toExcel.cfm?store='+encodedStore);
But I think that's not a good way, you will have a lot of overhead and informations (from the store) you don't really need!
I think it's better to submit your parameters(filters etc.) and get the data (f.e. from the db) serversided new.

Sorry for the bad english!

Greetings