{ "id": "147905", "key": "AC-948", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2015-08-30T08:13:52.000+0000", "created": "2015-05-18T07:46:12.000+0000", "labels": [ "ios", "listSections", "listView", "templates" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:37:16.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "{code:title=Environment}\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.10.4\r\n Architecture = 64bit\r\n # CPUs = 8\r\n Memory = 17179869184\r\nNode.js\r\n Node.js Version = 0.10.38\r\n npm Version = 1.4.28\r\nTitanium CLI\r\n CLI Version = 4.1.0-dev\r\nTitanium SDK\r\n SDK Version = 4.1.0.v20150516202834\r\n SDK Path = /Volumes/Data/Users/sebastian/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.v20150516202834\r\n Target Platform = iphone\r\n{code}\r\n\r\nUsing sections for each row with additional marker will not work when using templates\r\n\r\n{code:title=Does not work}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\r\nvar plainTemplate = {\r\n childTemplates: [\r\n {\r\n type: 'Ti.UI.Label', // Use a label\r\n bindId: 'rowtitle', // Bind ID for this label\r\n properties: { // Sets the Label.left property\r\n left: '10dp'\r\n }\r\n },\r\n {\r\n type: 'Ti.UI.ImageView', // Use an image view\r\n bindId: 'pic', // Bind ID for this image view\r\n properties: { // Sets the ImageView.image property\r\n image: 'KS_nav_ui.png'\r\n }\r\n },\r\n {\r\n type: 'Ti.UI.Button', // Use a button\r\n bindId: 'button', // Bind ID for this button\r\n properties: { // Sets several button properties\r\n width: '80dp',\r\n height: '30dp',\r\n right: '10dp',\r\n title: 'press me'\r\n },\r\n events: {click: report} // Binds a callback to the button's click event\r\n }\r\n ]\r\n};\r\nfunction report(e) {\r\n Ti.API.info(e.type);\r\n}\r\nvar listView = Ti.UI.createListView({\r\n // Maps the plainTemplate object to the 'plain' style name\r\n templates: {'plain': plainTemplate},\r\n // Use the plain template, that is, the plainTemplate object defined earlier\r\n // for all data list items in this list view\r\n defaultItemTemplate: 'plain'\r\n});\r\nvar sectionData = [];\r\nvar i = 25;\r\nfor (var k = 0; k < 25; k++) {\r\n var section = Ti.UI.createListSection();\r\n section.setItems([{\r\n properties: {\r\n title: 'Row ' + (k + 1)\r\n },\r\n rowtitle: {\r\n text: 'Row ' + (k + 1)\r\n }\r\n }]);\r\n sectionData.push(section);\r\n}\r\nlistView.setSections(sectionData);\r\n\r\n// Set the initial item threshold\r\nlistView.setMarker({sectionIndex: (i - 1), itemIndex: 0});\r\n\r\n// Load more data and set a new threshold when item threshold is reached\r\nlistView.addEventListener('marker', function (e) {\r\n var max = i + 25;\r\n var data = [];\r\n for (var k = i; k < max; k++) {\r\n var section = Ti.UI.createListSection();\r\n section.setItems([{\r\n properties: {\r\n title: 'Row ' + (k + 1)\r\n },\r\n rowtitle: {\r\n text: 'Row ' + (k + 1)\r\n }\r\n }]);\r\n listView.appendSection(section);\r\n }\r\n i = i + 25;\r\n listView.setMarker({sectionIndex: (i - 1), itemIndex: 0});\r\n});\r\n\r\nwin.add(listView);\r\nwin.open();\r\n{code}\r\n\r\nReplacing the listview create method with \r\n{code}\r\nvar listView = Ti.UI.createListView({\r\n // Maps the plainTemplate object to the 'plain' style name\r\n //templates: {'plain': plainTemplate},\r\n // Use the plain template, that is, the plainTemplate object defined earlier\r\n // for all data list items in this list view\r\n //defaultItemTemplate: 'plain'\r\n});\r\n{code}\r\n\r\nLet the marker work again", "attachment": [ { "id": "55462", "filename": "TestApp.zip", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-05-19T07:27:39.000+0000", "size": 2954631, "mimeType": "application/zip" } ], "flagged": false, "summary": "ListView Marker won't work with sections and templates", "creator": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "352932", "author": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "body": "[~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? \r\nThanks", "updateAuthor": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "created": "2015-05-19T02:13:29.000+0000", "updated": "2015-05-19T02:13:29.000+0000" }, { "id": "352956", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "Start the TestApp and scroll down. As you see, the marker will not be fired", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-05-19T07:27:59.000+0000", "updated": "2015-05-19T07:27:59.000+0000" }, { "id": "352962", "author": { "name": "hmrida", "key": "hmrida", "displayName": "Harish Mridha", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hi\r\nI have tested new TestApp . marker event fired properly . \r\n*Code*\r\n{code}\r\n\r\nlistView.addEventListener('marker', function (e) {\r\n\tTi.API.info(\"marker Fired when the list view displays the reference item or an item beyond the reference item.\");\r\n var max = i + 25;\r\n var data = [];\r\n for (var k = i; k < max; k++) {\r\n var section = Ti.UI.createListSection();\r\n section.setItems([{\r\n properties: {\r\n title: 'Row ' + (k + 1)\r\n },\r\n rowtitle: {\r\n text: 'Row ' + (k + 1)\r\n }\r\n }]);\r\n listView.appendSection(section);\r\n Ti.API.info('Row ' + (k + 1));\r\n }\r\n i = i + 25;\r\n listView.setMarker({sectionIndex: (i - 1), itemIndex: 0});\r\n});\r\n\r\n{code}\r\n\r\n*Log*\r\n{code}\r\n\r\n[INFO] : Application started\r\n[INFO] : TestApp/1.0 (4.0.0.9b7d303)\r\n[INFO] : marker Fired when the list view displays the reference item or an item beyond the reference item.\r\n[INFO] : Row 26\r\n[INFO] : Row 27\r\n[INFO] : Row 28\r\n[INFO] : Row 29\r\n[INFO] : Row 30\r\n[INFO] : Row 31\r\n[INFO] : Row 32\r\n[INFO] : Row 33\r\n[INFO] : Row 34\r\n[INFO] : Row 35\r\n[INFO] : Row 36\r\n[INFO] : Row 37\r\n[INFO] : Row 38\r\n[INFO] : Row 39\r\n[INFO] : Row 40\r\n[INFO] : Row 41\r\n[INFO] : Row 42\r\n[INFO] : Row 43\r\n[INFO] : Row 44\r\n[INFO] : Row 45\r\n[INFO] : Row 46\r\n[INFO] : Row 47\r\n[INFO] : Row 48\r\n[INFO] : Row 49\r\n[INFO] : Row 50\r\n\r\n{code}", "updateAuthor": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "created": "2015-05-19T09:47:13.000+0000", "updated": "2015-06-27T00:09:23.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }