Operating System
Name = Mac OS X
Version = 10.10.4
Architecture = 64bit
# CPUs = 8
Memory = 17179869184
Node.js
Node.js Version = 0.10.38
npm Version = 1.4.28
Titanium CLI
CLI Version = 4.1.0-dev
Titanium SDK
SDK Version = 4.1.0.v20150516202834
SDK Path = /Volumes/Data/Users/sebastian/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.v20150516202834
Target Platform = iphone
Using sections for each row with additional marker will not work when using templates
var win = Ti.UI.createWindow({backgroundColor: 'white'});
var plainTemplate = {
childTemplates: [
{
type: 'Ti.UI.Label', // Use a label
bindId: 'rowtitle', // Bind ID for this label
properties: { // Sets the Label.left property
left: '10dp'
}
},
{
type: 'Ti.UI.ImageView', // Use an image view
bindId: 'pic', // Bind ID for this image view
properties: { // Sets the ImageView.image property
image: 'KS_nav_ui.png'
}
},
{
type: 'Ti.UI.Button', // Use a button
bindId: 'button', // Bind ID for this button
properties: { // Sets several button properties
width: '80dp',
height: '30dp',
right: '10dp',
title: 'press me'
},
events: {click: report} // Binds a callback to the button's click event
}
]
};
function report(e) {
Ti.API.info(e.type);
}
var listView = Ti.UI.createListView({
// Maps the plainTemplate object to the 'plain' style name
templates: {'plain': plainTemplate},
// Use the plain template, that is, the plainTemplate object defined earlier
// for all data list items in this list view
defaultItemTemplate: 'plain'
});
var sectionData = [];
var i = 25;
for (var k = 0; k < 25; k++) {
var section = Ti.UI.createListSection();
section.setItems([{
properties: {
title: 'Row ' + (k + 1)
},
rowtitle: {
text: 'Row ' + (k + 1)
}
}]);
sectionData.push(section);
}
listView.setSections(sectionData);
// Set the initial item threshold
listView.setMarker({sectionIndex: (i - 1), itemIndex: 0});
// Load more data and set a new threshold when item threshold is reached
listView.addEventListener('marker', function (e) {
var max = i + 25;
var data = [];
for (var k = i; k < max; k++) {
var section = Ti.UI.createListSection();
section.setItems([{
properties: {
title: 'Row ' + (k + 1)
},
rowtitle: {
text: 'Row ' + (k + 1)
}
}]);
listView.appendSection(section);
}
i = i + 25;
listView.setMarker({sectionIndex: (i - 1), itemIndex: 0});
});
win.add(listView);
win.open();
Replacing the listview create method with
var listView = Ti.UI.createListView({
// Maps the plainTemplate object to the 'plain' style name
//templates: {'plain': plainTemplate},
// Use the plain template, that is, the plainTemplate object defined earlier
// for all data list items in this list view
//defaultItemTemplate: 'plain'
});
Let the marker work again
[~benutzername] we can not replicate this issue, and it looks like the attached test case is not related to this, can you please check and try to share more info on how to replicate? Thanks
Start the TestApp and scroll down. As you see, the marker will not be fired
Hi I have tested new TestApp . marker event fired properly . *Code*
*Log*