PDA

View Full Version : View images not getting x-item-selected on click



gtsafas
8 Jun 2012, 9:16 PM
Not sure what I am doing wrong. I have some basic images that load. I would think clicking would highlight them, Not sure what I am doing wrong. Any help is appreciated.



Ext.create("Ext.panel.Panel", {
'border': 0,
'collapsible': True,
'height': 310,
'items': [{
'xtype': Ext.create("Ext.view.View", {
'autoScroll': True,
'border': 0,
'cls': 'x-image-view',
'emptyText': 'no images to display',
'flex': 1,
'itemSelector': 'div.thump-wrap',
'overItemCls': 'x-item-over',
'selectedCls': 'x-item-selected',
'store': Ext.create("Ext.data.Store", {
'autoLoad': True,
'fields': [{
'name': 'name'
}, {
'name': 'url'
}, {
'name': 'size',
'type': 'float'
}, {
'dateFormat': 'timestamp',
'name': 'lastmod',
'type': 'date'
}],
'proxy': {
'reader': {
'root': 'images',
'type': 'json'
},
'type': 'ajax',
'url': '/data/images'
}
}),
'tpl': ['<tpl for=".">', '<div class="thumb-wrap">', '<div class="thumb">', '<img src="{url} width="100" height="80"/></div>', '<span>{name}</span>', '</div>', '</tpl>'],
'trackOver': True
})
}],
'layout': 'fit',
'region': 'center',
'title': 'blah',
'width': 535
})

mitchellsimoens
11 Jun 2012, 7:11 AM
Inspect the DOM. The element you clicked on, did it get the x-item-selected class? If so, what styles did that give you?

Also, all the single-quotes on the properties in the objects aren't needed. Just extra characters you don't need.