Threaded View
-
9 Jan 2013 2:03 AM #1
List with useComponents:true dosen't fire the itemtap event
List with useComponents:true dosen't fire the itemtap event
REQUIRED INFORMATION
Ext version tested:- Sencha Touch 2.1
- Chrome 23.0
- As this thread, on Sencha Touch 2.1 I think that Ext.dataview.List can handle ListItem with components. So I tried to use ListItem, then it showed records in components. But the item tap event were not fired. It seems that components interrupt touch events.
- Define a class extended from Ext.dataview.List with configuration set as useComponents:true, defaultType:[correspond ListItem's xtype].
- Define a class extended from Ext.dataview.component.ListItem.
- Create a instance of the List class and add it as a main view.
- Click a list item.
- The itemtap event is fired.
- Click a list item.
- The itemtap event is never fired except a area around right end of each items.
List.js
ListItem.jsCode:Ext.define('WSChat.view.List', { extend: 'Ext.dataview.List', xtype: 'list', requires: [ 'Ext.data.Store', 'WSChat.view.ListItem', ], config: { title: 'Names', store: { fields: ['name', 'age'], data: [ {name: 'Jamie', age: 100}, {name: 'Rob', age: 21}, {name: 'Tommy', age: 24}, {name: 'Jacky', age: 24}, {name: 'Ed', age: 26} ] }, //itemTpl: '{name}:{age}', useComponents: true, defaultType: 'listitem', listeners: { itemtap: function( list, index, item, record){ console.log(record); console.log('Item tapped:' + record.get('name')); }, }, } });
HELPFUL INFORMATIONCode:Ext.define('WSChat.view.ListItem', { extend: 'Ext.dataview.component.ListItem', xtype: 'listitem', requires: [ 'Ext.Panel', 'Ext.Label', ], config: { layout: 'hbox', items: [ {xtype: 'panel', itemId:'name', flex: 1, width: "100%", height: "100%"}, {xtype: 'label', itemId:'age', docked: 'bottom', style: 'font-size: 75%'}, ], listeners: { updatedata: function( listItem, newData, eOpts ){ if(newData != null){ listItem.getComponent('name').setHtml(newData.name); listItem.getComponent('age').setHtml(newData.age); } } } }, });
Debugging already done:- none
- not provided
- only default ext-all.css
- Mac OS X 10.7.4
You found a bug! We've classified it as
TOUCH-3894
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote