PDA

View Full Version : Simple List



UbuntuPenguin
25 Apr 2012, 9:46 AM
Is there a simple list in the Ext JS library ? I have tried looking for one, but all that seems to pop up is GridPanel. I tried to use the GridPanel with a single column, but the rendered view seems to have 1.5 columns.

Any help is greatly appreciated

slemmon
25 Apr 2012, 11:22 AM
Try setting flex: 1 on your column.



Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['name', 'email', 'phone'],
data:{'items':[
{ 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224" },
{ 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234" },
{ 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244" },
{ 'name': 'Marge', "email":"marge@simpsons.com", "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', flex: 1 }
],
height: 200,
width: 400,
renderTo: Ext.getBody()
});

UbuntuPenguin
25 Apr 2012, 8:00 PM
Well, um, there you have it.