[TIMOB-24919] Windows: Add support for template.events
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-07-07T18:38:12.000+0000 |
Affected Version/s | Release 6.1.1 |
Fix Version/s | Release 6.2.0 |
Components | Windows |
Labels | n/a |
Reporter | Gary Mathews |
Assignee | Gary Mathews |
Created | 2017-07-03T12:09:22.000+0000 |
Updated | 2017-08-09T18:46:08.000+0000 |
Description
- Add support for setting template item events using the
template.events
property
*TEST CASE*
var win = Ti.UI.createWindow({ backgroundColor: 'white' }),
list = Ti.UI.createListView({
templates: {
template: {
events: {
click: onClick
},
childTemplates: [
{
type: 'Ti.UI.Label',
bindId: 'title',
properties: {
left: '5dp',
right: '5dp'
}
}
]
}
},
defaultItemTemplate: 'template'
}),
section = Ti.UI.createListSection(),
items = [];
function onClick(e) {
alert('CLICK!');
}
for (var i = 0; i < 5; i++) {
items.push({
title: { text: 'TEXT' }
});
}
section.setItems(items);
list.setSections([section]);
win.add(list);
win.open();
master: https://github.com/appcelerator/titanium_mobile_windows/pull/1031
Verified fix in SDK Version 6.2.0.v20170808012225 and SDK Version 7.0.0.v20170808071205. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile_windows/pull/1031