PDA

View Full Version : Multiple Grids



sunder10
18 Feb 2013, 9:17 PM
Hi,
I have more than 15 tables in my page to view.I m in doubt whether it may cause performance problem if i choose girds for that.If so then it will be 15 multiple grids or more than that.Does it cause a performance issue.? Which is the best way whether multiple grids or multiple tables?

scottmartin
19 Feb 2013, 11:48 AM
You can give this a try:



Ext.onReady(function(){

Ext.create('Ext.data.Store', {
storeId : 'simpsonsStore',
fields : ['name', 'email', 'change'],
data : {'items' : [
{ 'name' : 'Lisa', 'email' : '[email protected]', 'change' : 100 },
{ 'name' : 'Bart', 'email' : '[email protected]', 'change' : -20 },
{ 'name' : 'Homer', 'email' : '[email protected]', 'change' : 23 },
{ 'name' : 'Marge', 'email' : '[email protected]', 'change' : -11 }
]},
proxy : {
type : 'memory',
reader : {
type : 'json',
root : 'items'
}
}
});

Ext.define('MY.grid', {
extend: 'Ext.grid.Panel',
alias: 'widget.simpsonsgrid',
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ header: 'Name', dataIndex: 'name' },
{ header: 'Email', dataIndex: 'email', flex: 1 },
{ header: 'Change', dataIndex: 'change', tdCls: 'x-change-cell' }
]
});

var panel = Ext.widget('panel', {
renderTo: Ext.getBody(),
width: 600,
height: 500,
layout: {
type: 'vbox',
align: 'stretch'
},
items: [{}]
});

for (i = 0; i < 3; i++){
panel.add(Ext.widget({
xtype: 'simpsonsgrid',
height: 150
}));
}

});


Scott.