PDA

View Full Version : Dataview doesn't fire click event



ICARDA
7 Apr 2012, 5:49 AM
Hi,

I'm facing problem in working on dataview control, the control doesn't fire click event, can please check the code below and guide me about the problem.


<style>
.acc-list-item {
border: 1px solid #FFFFFF;
cursor: pointer;
font-size: 11px;
line-height: 20px;
margin-top: 3px;
padding-left: 20px;
}
.x-item-selected {
background-color: #DFE8F6;
border: 1px dotted #A3BAE9;
color: #15428B;
font-weight: bold;
}
.acc-list-item-hover {
background-color: #EEEEEE;
}
</style>


var contentData = [['Chains','chainslink'],
['Localtions','locationslink'],
['Hotels','hotelslink'],
['Restaurants','restaurantslink'],
['Accommodations','accommodationslink'],
['Facilities','facilitieslink'],
['Classes','classeslink'],
['Contact Types','contacttypeslink'],
['Markets','marketslink']];
var contentStore = Ext.create('Ext.data.ArrayStore', {
fields: [
{name: 'title'},
{name: 'url'}
],
data: contentData
});
var contentItems = new Ext.DataView({
autoScroll: true, store: contentStore, tpl: '<tpl for="."><div class="acc-list-item">{title}</div></tpl>',
autoHeight: false, trackOver: true,
itemSelector: '.acc-list-item',
overItemCls: 'acc-list-item-hover',
emptyText: 'No Options Available',
style: 'border:1px solid #99BBE8;background:#fff;',
listeners : {
click : {
fn : function( dataView, index, node, e) {
var record = dataView.getRecord(node);
alert(record.get("title"));
}
}
}
});

Animal
7 Apr 2012, 6:36 AM
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.view.View-event-itemclick

ICARDA
7 Apr 2012, 6:42 AM
Thank you, problem solved.