PDA

View Full Version : How to add a list icon?



justinKohactive
29 Nov 2011, 7:37 PM
I see this class, i am trying to add a pictos icon to my list items, anyone know how to do this?

linuxyf
29 Nov 2011, 10:29 PM
use componentView, look into kiva example

SunboX
1 Dec 2011, 7:52 AM
I want to add a Ext.field.Checkbox to every list item. How to do this?

greetings Sunny

linuxyf
1 Dec 2011, 4:55 PM
I want to add a Ext.field.Checkbox to every list item. How to do this?

greetings Sunny

use componentView, refer to kiva example

Brendan Carroll
1 Dec 2011, 7:38 PM
ComponetView may be a bit too heavy depending on what you want to do. If all you want is to add an icon simply define the placeholder in your itemTpl like so.



Ext.define('Sha.view.CatagoriesList', {
extend: 'Ext.List',
xtype: 'catagorieslist',
headerTitle: 'Categories',
config: {
allowDeselect: true,
store: 'Catagories',
itemTpl: '<img src="{PHOTO}" class="imgItm"/><div class="name">{TYPE}</div>'
},

initialize: function () {
//console.log('initialize caatagories list');
this.callParent();
}
});


If it's the same icon for every list item than it gets even easier and you can do it all in your css.