Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24919] Windows: Add support for template.events

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2017-07-07T18:38:12.000+0000
Affected Version/sRelease 6.1.1
Fix Version/sRelease 6.2.0
ComponentsWindows
Labelsn/a
ReporterGary Mathews
AssigneeGary Mathews
Created2017-07-03T12:09:22.000+0000
Updated2017-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();

Comments

  1. Gary Mathews 2017-07-03

    master: https://github.com/appcelerator/titanium_mobile_windows/pull/1031
  2. Samir Mohammed 2017-08-09

    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

JSON Source