Forum /
Sencha Touch 2.x Forums /
Sencha Touch 2.x: Q&A /
Unanswered: Better view for a list/dataview ?
Unanswered: Better view for a list/dataview ?
Hi,
I have a list and i wonder if it is possible to transform it with a better rendering.
I mean provide a look style as a spreadsheet with columns well separated and a top row that display the title's colum.
I am looking also for displaying pictures in some cells.
I have checked if a dataview can be used but the look and feel is not the one expected.
Thanks in advance for your reply.
Regards
You will need a custom class
You will need a custom class
A custom class will let you define your own html, I'm quite new here but here is a link that will help
http://www.sencha.com/learn/sencha-touch-2-class-system/
s orry more concise
http://docs.sencha.com/touch/1-1/#!/api/Ext.XTemplate
h ere is some example code that gives you the IDEA only as it doesnt work but look at the itemTpl part here you set your html and it gets populated in a loop for each element
Ext.define('Ap.view.markets.Olist', {
extend: 'Ext.List',
xtype:'olist'
});
Ext.create('Ext.List', {
fullscreen: true,
store: {
fields: ['name'],
data: [
{name: 'Cowper'},
{name: 'Everett'},
{name: 'University'},
{name: 'Forest'}
]
},
itemTpl: '{name}',
listeners: {
select: function(view, record) {
Ext.Msg.alert('Selected!', 'You selected ' + record.get('name'));
}
}
});
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us