{ "id": "138090", "key": "AC-1206", "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": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2015-04-10T10:37:19.000+0000", "created": "2014-10-15T09:35:00.000+0000", "labels": [ "TCSupportTriage" ], "versions": [], "issuelinks": [], "assignee": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "updated": "2016-03-08T07:37:35.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "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": "Marker event on ListView component isn't launched when the row on which there is the marker is showed arriving on it not scrolling, but deleting the rows one by one (using the deleteItemsAt() method on the listItem section).", "attachment": [], "flagged": false, "summary": "Issue on ListView's marker event", "creator": { "name": "pic", "key": "pic", "displayName": "Mauro Piccotti", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pic", "key": "pic", "displayName": "Mauro Piccotti", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK 3.4.0\r\niOS 8.0", "comment": { "comments": [ { "id": "328291", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Hi,\r\n\r\nWould you please provide us a test case to reproduce your problem, that will be really helpful. Thanks.\r\n\r\nRegard,\r\nShuo", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-10-16T04:07:38.000+0000", "updated": "2014-10-16T04:07:38.000+0000" }, { "id": "328306", "author": { "name": "pic", "key": "pic", "displayName": "Mauro Piccotti", "active": true, "timeZone": "America/Los_Angeles" }, "body": "You are right, but it's a little complex to create a working example extracting it from my software, I'll try as I'll find time. Have you ever heard about this problem? Does it have sense in your opinion? Because I thought that the marker event probably works only scrolling the list, and in my case I don't scroll.", "updateAuthor": { "name": "pic", "key": "pic", "displayName": "Mauro Piccotti", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-16T08:28:00.000+0000", "updated": "2014-10-16T08:28:00.000+0000" }, { "id": "330065", "author": { "name": "pic", "key": "pic", "displayName": "Mauro Piccotti", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I try to do a little summary.\r\nThe ListView \"list\" is created on the Alloy's xml file, it has only one section, created dynamically by code.\r\nI attached a marker event to the list, where I launch my search function. My search function can append result or not, if I launch it from the marker I append, otherwise before I clear the list.\r\nAt the end of my search function I set a marker, but only if the last result gave at least one result. I append the marker doing this:\r\n$.list.setMarker({\r\n\t'sectionIndex': 0,\r\n\t'itemIndex': $.list.sections[0].items.length - 1 - parseInt(pageSize * 0.7)\r\n});\r\nOn the event itemclick of the list, if the pressed bindId is of my delete button, I delete the row using: $.list.sections[0].deleteItemsAt(itemIndex,1);\r\n\r\nWithout deleting everything works well, but if I press the \"delete button\" on the list the marker event isn't lanuched.", "updateAuthor": { "name": "pic", "key": "pic", "displayName": "Mauro Piccotti", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-30T11:56:01.000+0000", "updated": "2014-10-30T11:56:01.000+0000" }, { "id": "349160", "author": { "name": "pchowdhury", "key": "pchowdhury", "displayName": "Papia Chowdhury", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello\r\nWe have tested this issue. According to documentation: “The marker event is fired only once. You need to use the setMarkermethod again to set a new item threshold and the marker event will be fired once again.”\r\nMarker event works as expected. Its not a bug.\r\n\r\nTesting Environment:\r\nTitanium Sdk: 3.5.0 GA, 3.5.1GA\r\nTitanium CLI: 3.4.1\r\niOS simulator: iphone 4s(v8.1)\r\nOS X version: 10.9.5\r\n\r\nSteps to Test:\r\n1.Run below code\r\n2.Tap on any row and delete\r\n3.Scroll down(Row appends as expected)\r\n\r\nPossible Workaround:\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white', fullscreen: true});\r\nvar listView = Ti.UI.createListView();\r\nvar section = Ti.UI.createListSection();\r\nvar sectionData = [];\r\nvar i = 25;\r\nfor (var k = 0; k < 25; k++) {\r\n sectionData.push({\r\n properties : {\r\n title: 'Row ' + (k + 1)\r\n }\r\n });\r\n}\r\nsection.setItems(sectionData);\r\nlistView.sections = [section];\r\nwin.add(listView);\r\nwin.open();\r\n\r\n// Set the initial item threshold\r\nlistView.setMarker({sectionIndex:0, itemIndex: (i - 1) });\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 data.push({\r\n properties : {\r\n title: 'Row ' + (k + 1)\r\n }\r\n });\t\t\r\n }\r\n section.appendItems(data);\r\n i = i + 25;\r\n listView.setMarker({sectionIndex:0, itemIndex: (i - 1)});\r\n});\r\n\r\n\r\n //listview event listener\r\n listView.addEventListener('itemclick', function(e){ \r\n\r\n var section = e.section;\r\n\r\n var itenIndex = e.itemIndex;\r\n\r\n var confirm = Ti.UI.createAlertDialog({\r\n\r\n title : 'Delete the row?',\r\n\r\n buttonNames : ['Yes','No']\r\n\r\n });\r\n\r\n confirm.addEventListener('click', function(e){\r\n\r\n if(e.index == 0){\r\n\r\n section.deleteItemsAt(itenIndex,1);\r\n //again set the thresh hold\r\n listView.setMarker({sectionIndex:0, itemIndex: (itenIndex+1) });\r\n }\r\n });\t\t\r\n\r\n confirm.show();\r\n});\r\n{code}\r\n ", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2015-04-10T10:19:35.000+0000", "updated": "2015-04-10T10:36:29.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }