PDA

View Full Version : How to send data to another page on buttonclick



dhoom20022000
5 Nov 2013, 1:08 AM
I have created a grid , and also have a button . I want to send this grid data to another page so that i can access from there on clicking the button .

my full code is this


Ext.onReady(function() {
Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['name', 'email', 'phone'],
data:{'items':[
{"name":"Lisa", "email":"[email protected]", "phone":"555-111-1224"},
{"name":"Bart", "email":"[email protected]", "phone":"555--222-1234"},
{"name":"Homer", "email":"[email protected]", "phone":"555-222-1244"},
{"name":"Marge", "email":"[email protected]", "phone":"555-222-1254"}
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});


Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{header: 'Name', dataIndex: 'name', editor: 'textfield'},
{header: 'Email', dataIndex: 'email', flex:1,
editor: {
xtype: 'textfield',
allowBlank: false
}
},
{header: 'Phone', dataIndex: 'phone'}
],
selType: 'cellmodel',
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})
],
height: 600,
width: 600,
renderTo: Ext.getBody()
});
Ext.create('Ext.Button', {
text: 'Click me',
renderTo: Ext.getBody(),
handler: function() {
window.open("prac.html?a="+store, "_self")
}
});


});

keckeroo
13 Nov 2013, 7:36 AM
Hi there,

If i understand your coding, it appears you'd like to be able to pass (in concept) a store to another webpage/sencha application ?

I'm not entirely sure why you would want to do it that way. Sencha apps are all single page applications which can easily accommodate multitple screens just by using some of our components (such as card panels, tabs, etc).

Could you elaborate your end goal here ?