{ "id": "165498", "key": "TIMOB-24351", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-08-15T15:28:08.000+0000", "created": "2017-01-27T21:59:46.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" }, { "id": "18154", "name": "Release 6.0.1", "archived": false, "released": true, "releaseDate": "2016-12-21" } ], "issuelinks": [ { "id": "54046", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "outwardIssue": { "id": "165427", "key": "TIMOB-24335", "fields": { "summary": "iOS: Resolve iOS 8 deprecations", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "6", "description": "gh.issue.epic.desc", "name": "Epic", "subtask": false } } } } ], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-08-18T17:20:24.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h5. Issue Description \r\n\r\nAdding the EditActions for the listview. Listview also having the search functionality using SearchBar Edit Functionalities are working especially swipe to delete in the list view data.\r\nBut, Using the search bar, tapping on searching the results, swipe to delete feature is not working\r\n\r\nh5.Steps to replicate \r\n# Download the project from here: https://drive.google.com/file/d/0BwTWo-c2a0b9X2NkbG5la0VJWnM/view?usp=sharing\r\n# Run the project\r\n# Swipe on the list items to see the options in the rows\r\n# Make a search like \"papaya\"\r\n# Swipe again to see the options in a result \r\n# The option is not showing. \r\n\r\nh5. Expected results \r\n\r\nList item options should be showed even after search", "attachment": [], "flagged": false, "summary": "iOS: Support \"editActions\" in listview search-results", "creator": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "ios 10.2 \r\nSDK 6.0.1GA, 6.0.0GA \r\nCLI 6.1.0", "comment": { "comments": [ { "id": "405599", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This can be achieved as soon as we migrate the {{UISearchDisplayController}} to the {{UISearchController}}. See TIMOB-24335 for details.\r\n\r\nTest-Case (to be achieved):\r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar list = Ti.UI.createListView({\r\n searchView: Ti.UI.createSearchBar(),\r\n sections: [Ti.UI.createListSection({\r\n items: [{\r\n properties: {\r\n title: \"Item 1\",\r\n canEdit: true,\r\n searchableText: \"Item 1\",\r\n editActions: [{title: \"Delete\"}, {title: \"Edit\"}]\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 2\",\r\n canEdit: true,\r\n searchableText: \"Item 2\",\r\n editActions: [{title: \"Delete\"}, {title: \"Edit\"}]\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 3\",\r\n canEdit: true,\r\n searchableText: \"Item 3\",\r\n editActions: [{title: \"Delete\"}, {title: \"Edit\"}]\r\n }\r\n }]\r\n })]\r\n})\r\n\r\nwin.add(list);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-30T10:41:55.000+0000", "updated": "2017-01-30T20:06:02.000+0000" }, { "id": "408418", "author": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Any updates here? ", "updateAuthor": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-02T19:15:12.000+0000", "updated": "2017-03-02T19:15:12.000+0000" }, { "id": "412100", "author": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi [~emerriman] Is possible to include this one on the current sprint ?", "updateAuthor": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-14T17:09:33.000+0000", "updated": "2017-03-14T17:09:33.000+0000" }, { "id": "417531", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reproduced with this environment:\r\nNode Version: 6.10.1\r\nNPM Version: 3.10.10\r\nMac OS: 10.12.4\r\nAppc CLI: 6.2.0\r\nAppc CLI NPM: 4.2.9\r\nTitanium SDK version: 6.0.3.GA\r\nAppcelerator Studio, build: 4.8.1.201612050850\r\nXcode 8.2.1\r\n\r\n[~emerriman] Yes, I can reproduce it. Without any filtering, when I swipe to the left on any list item, there are options to either edit or delete. When I type anything in the search field, and I select any items that matched the search, the options do not appear if I try to swipe left on any selected item.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-04-17T23:02:29.000+0000", "updated": "2017-04-17T23:02:29.000+0000" }, { "id": "417675", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "We will be able to fix this when TIMOB-24335 is implemented, see the above comments for details.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-19T15:44:55.000+0000", "updated": "2017-04-19T15:44:55.000+0000" }, { "id": "424362", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/9227\r\n\r\nTest Cases -\r\n/// Search with search bar and listview\r\n{code:java}\r\n\r\n1.\r\n//1. Default edit action i.e delete\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n \r\nvar sb = Ti.UI.createSearchBar();\r\nvar list = Ti.UI.createListView({\r\n top: 50,\r\n keepSectionsInSearch: true,\r\n pruneSectionsOnEdit: true,\r\n sections: [Ti.UI.createListSection({\r\n headerTitle:\"Item List 1\",\r\n items: [{\r\n properties: {\r\n title: \"Item 1\",\r\n canEdit: true,\r\n searchableText: \"Item 1\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 2\",\r\n canEdit: true,\r\n searchableText: \"Item 2\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 3\",\r\n canEdit: true,\r\n searchableText: \"Item 3\",\r\n }\r\n }\r\n ]\r\n }),\r\n Ti.UI.createListSection({\r\n headerTitle:\"Item List 2\",\r\n\r\n items: [{\r\n properties: {\r\n title: \"Item 4\",\r\n canEdit: true,\r\n searchableText: \"Item 4\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 5\",\r\n canEdit: true,\r\n searchableText: \"Item 5\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 6\",\r\n canEdit: true,\r\n searchableText: \"Item 6\",\r\n }\r\n }\r\n ]\r\n })]\r\n})\r\n \r\n list.addEventListener(\"delete\", function(e){\r\n Ti.API.info(\"Deleted Row Index is is: \" +e.itemIndex);\r\n Ti.API.info(\"Deleted Section Index is is: \" +e.sectionIndex);\r\n\r\n });\r\n\r\nvar searchBar = Ti.UI.createSearchBar({\r\n height:44,\r\n top:0,\r\n barColor:'#000',\r\n showCancel:true,\r\n});\r\nsearchBar.addEventListener('change', function(e){\r\n Ti.API.info(\"searched item is: \"+e.value);\r\n list.searchText = e.value;\r\n});\r\n\r\nsearchBar.addEventListener('return', function(e){\r\nsearchBar.blur();\r\n});\r\n\r\nsearchBar.addEventListener('cancel', function(e){\r\nsearchBar.blur();\r\n});\r\n\r\nwin.add(searchBar);\r\nwin.add(list);\r\nwin.open();\r\n{code}\r\n\r\n2.\r\n\r\n{code:java}\r\n//2. Actions\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'}),\r\n\r\n favoriteAction = {\r\n identifier: 'setFavorite',\r\n title: 'Favorite',\r\n style: Ti.UI.iOS.ROW_ACTION_STYLE_DEFAULT,\r\n },\r\n unfavoriteAction = {\r\n identifier: 'unsetFavorite',\r\n title: 'Unfavorite',\r\n style: Ti.UI.iOS.ROW_ACTION_STYLE_NORMAL,\r\n },\r\n deleteAction = {\r\n identifier: 'delete',\r\n title: 'Delete',\r\n style: Ti.UI.iOS.ROW_ACTION_STYLE_NORMAL,\r\n },\r\n data1 = [\r\n {properties: {canEdit: true, editActions: [favoriteAction, deleteAction], title: 'Kitten Whiskers', searchableText:'Kitten Whiskers'}},\r\n {properties: {canEdit: true, editActions: [favoriteAction, deleteAction], title: 'Copper Kettle', searchableText:'Copper Kettle'}},\r\n {properties: {canEdit: true, editActions: [favoriteAction, deleteAction], title: 'Woolen Mittens', searchableText:'Woolen Mittens'}},\r\n ],\r\n\r\n listSection1 = Ti.UI.createListSection({\r\n items: data1\r\n }),\r\n\r\n data2 = [\r\n {properties: {canEdit: true, editActions: [favoriteAction, deleteAction], title: 'Apple Strudel', searchableText:'Apple Strudel'}},\r\n {properties: {canEdit: true, editActions: [favoriteAction, deleteAction], title: 'Brown Packages', searchableText:'Brown Packages'}},\r\n {properties: {canEdit: true, editActions: [favoriteAction, deleteAction], title: 'Dog Bites', searchableText:'Dog Bites'}},\r\n {properties: {canEdit: true, editActions: [favoriteAction, deleteAction], title: 'Bee Stings', searchableText:'Bee Stings'}}\r\n ],\r\n listSection2 = Ti.UI.createListSection({\r\n items: data2\r\n }),\r\n listView = Ti.UI.createListView({\r\n top: 50,\r\n sections: [listSection1, listSection2]\r\n });\r\n\r\n listView.addEventListener('editaction', function(e) {\r\n var item = e.section.getItemAt(e.itemIndex)\r\n if (e.identifier === 'setFavorite') {\r\n item.properties.editActions = [unfavoriteAction, deleteAction];\r\n e.section.updateItemAt(e.itemIndex, item)\r\n } else if (e.identifier === 'unsetFavorite') {\r\n item.properties.editActions = [favoriteAction, deleteAction];\r\n e.section.updateItemAt(e.itemIndex, item, { animationStyle: Ti.UI.iOS.RowAnimationStyle.BOTTOM});\r\n\r\n } else if (e.identifier === 'delete') {\r\n e.section.deleteItemsAt(e.itemIndex, 1);\r\n\r\n }\r\n});\r\n\r\nvar searchBar = Ti.UI.createSearchBar({\r\n height:44,\r\n top:0,\r\n barColor:'#000',\r\n showCancel:true,\r\n});\r\nsearchBar.addEventListener('change', function(e){\r\n Ti.API.info(\"searched item is: \"+e.value);\r\n listView.searchText = e.value;\r\n});\r\n\r\nsearchBar.addEventListener('return', function(e){\r\nsearchBar.blur();\r\n});\r\n\r\nsearchBar.addEventListener('cancel', function(e){\r\nsearchBar.blur();\r\n});\r\n\r\nwin.add(searchBar); \r\nwin.add(listView);\r\nwin.open();\r\n\r\n{code}\r\n\r\n3.\r\n\r\n\r\n{code:java}\r\n// 3. Edit\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white', fullscreen: true, title: 'Shopping List'});\r\nvar navWin = Ti.UI.iOS.createNavigationWindow({window: win});\r\n \r\nvar listView = Ti.UI.createListView({\r\n pruneSectionsOnEdit: true,\r\n top:50,\r\n keepSectionsInSearch: true,\r\n }\r\n);\r\n \r\n// Listen when items are deleted or moved\r\nfunction report (e) {\r\n Ti.API.info('Item ' + e.itemIndex + ' was ' + e.type + 'd!');\r\n}\r\nlistView.addEventListener('delete', report);\r\nlistView.addEventListener('move', report);\r\n// Left navigation button to toggle between editing and selection mode\r\nvar button = Ti.UI.createButton({title: 'Edit'});\r\nwin.leftNavButton = button;\r\nvar flag = false;\r\nbutton.addEventListener('click', function(){\r\n flag = !flag;\r\n listView.editing = flag;\r\n if (flag) {\r\n button.title = \"Stop Editing\";\r\n } else {\r\n button.title = 'Edit';\r\n }\r\n});\r\n \r\nvar sections = [];\r\nvar fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});\r\nvar fruitDataSet = [\r\n {properties: { title: 'Apple', canEdit: true, canMove: true, searchableText:'Apple'}},\r\n {properties: { title: 'Banana', canEdit: true, canMove: true, searchableText:'Banana'}}\r\n];\r\nfruitSection.setItems(fruitDataSet);\r\nsections.push(fruitSection);\r\n \r\nvar vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables'});\r\nvar vegDataSet = [\r\n {properties: { title: 'Carrots',canEdit: true, canMove: true, searchableText:'Carrots'}},\r\n {properties: { title: 'Potatoes',canEdit: true, canMove: true, searchableText:'Potatoes'}}\r\n];\r\nvegSection.setItems(vegDataSet);\r\nsections.push(vegSection);\r\n \r\nvar fishSection = Ti.UI.createListSection({ headerTitle: 'Fish'});\r\nvar fishDataSet = [\r\n {properties: { title: 'Cod',canEdit: true, canMove: true, searchableText:'Cod'}},\r\n {properties: { title: 'Haddock',canEdit: true, canMove: true, searchableText:'Haddock'}}\r\n];\r\nfishSection.setItems(fishDataSet);\r\nsections.push(fishSection);\r\n \r\nlistView.sections = sections;\r\nvar searchBar = Ti.UI.createSearchBar({\r\n height:44,\r\n top:0,\r\n barColor:'#000', \r\n showCancel:true,\r\n});\r\nsearchBar.addEventListener('change', function(e){\r\n Ti.API.info(\"searched item is: \"+e.value);\r\n listView.searchText = e.value;\r\n});\r\n\r\nsearchBar.addEventListener('return', function(e){\r\nsearchBar.blur();\r\n});\r\n\r\nsearchBar.addEventListener('cancel', function(e){\r\nsearchBar.blur();\r\n});\r\n\r\nwin.add(searchBar); \r\nwin.add(listView);\r\nnavWin.open();\r\n{code}\r\n\r\n4.\r\n\r\n\r\n{code:java}\r\n//4. Insert\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white', fullscreen: true, title: 'Shopping List'});\r\nvar navWin = Ti.UI.iOS.createNavigationWindow({window: win});\r\n \r\nvar listView = Ti.UI.createListView({\r\n pruneSectionsOnEdit: true,\r\n top:50,\r\n keepSectionsInSearch: true,\r\n }\r\n);\r\n \r\n// Listen when items are deleted or moved\r\nfunction report (e) {\r\n Ti.API.info('Item ' + e.itemIndex + ' was ' + e.type + 'd!');\r\n}\r\nlistView.addEventListener('delete', report);\r\nlistView.addEventListener('move', report);\r\n// Left navigation button to toggle between editing and selection mode\r\nvar button = Ti.UI.createButton({title: 'Edit'});\r\nwin.leftNavButton = button;\r\nvar flag = false;\r\nbutton.addEventListener('click', function(){\r\n flag = !flag;\r\n listView.editing = flag;\r\n if (flag) {\r\n button.title = \"Stop Editing\";\r\n } else {\r\n button.title = 'Edit';\r\n }\r\n});\r\n \r\nvar sections = [];\r\nvar fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});\r\nvar fruitDataSet = [\r\n {properties: { title: 'Apple', canInsert: true, canMove: true, searchableText:'Apple'}},\r\n {properties: { title: 'Banana', canInsert: true, canMove: true, searchableText:'Banana'}}\r\n];\r\nfruitSection.setItems(fruitDataSet);\r\nsections.push(fruitSection);\r\n \r\nvar vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables'});\r\nvar vegDataSet = [\r\n {properties: { title: 'Carrots',canInsert: true, canMove: true, searchableText:'Carrots'}},\r\n {properties: { title: 'Potatoes',canInsert: true, canMove: true, searchableText:'Potatoes'}}\r\n];\r\nvegSection.setItems(vegDataSet);\r\nsections.push(vegSection);\r\n \r\nvar fishSection = Ti.UI.createListSection({ headerTitle: 'Fish'});\r\nvar fishDataSet = [\r\n {properties: { title: 'Cod',canInsert: true, canMove: true, searchableText:'Cod'}},\r\n {properties: { title: 'Haddock',canInsert: true, canMove: true, searchableText:'Haddock'}}\r\n];\r\nfishSection.setItems(fishDataSet);\r\nsections.push(fishSection);\r\n \r\nlistView.sections = sections;\r\nvar searchBar = Ti.UI.createSearchBar({\r\n height:44,\r\n top:0,\r\n barColor:'#000', \r\n showCancel:true,\r\n});\r\nsearchBar.addEventListener('change', function(e){\r\n Ti.API.info(\"searched item is: \"+e.value);\r\n listView.searchText = e.value;\r\n});\r\n\r\nsearchBar.addEventListener('return', function(e){\r\nsearchBar.blur();\r\n});\r\n\r\nsearchBar.addEventListener('cancel', function(e){\r\nsearchBar.blur();\r\n});\r\n\r\nlistView.addEventListener('insert', function(e) {\r\n var item = e.section.getItemAt(e.itemIndex);\r\n e.section.insertItemsAt(e.itemIndex, [item]);\r\n\r\n});\r\nwin.add(searchBar); \r\nwin.add(listView);\r\nnavWin.open();\r\n{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-19T08:47:26.000+0000", "updated": "2017-07-19T08:47:26.000+0000" }, { "id": "424363", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "/// Search using searchbar inbuilt in listview\r\n\r\n1. \r\n\r\n{code:java}\r\n//1. Default edit action i.e delete\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n \r\nvar list = Ti.UI.createListView({\r\n searchView: Ti.UI.createSearchBar(),\r\n keepSectionsInSearch: true,\r\n pruneSectionsOnEdit: true,\r\n sections: [Ti.UI.createListSection({\r\n headerTitle:\"List Item 1\",\r\n items: [{\r\n properties: {\r\n title: \"Item 1\",\r\n canEdit: true,\r\n searchableText: \"Item 1\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 2\",\r\n canEdit: true,\r\n searchableText: \"Item 2\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 3\",\r\n canEdit: true,\r\n searchableText: \"Item 3\",\r\n }\r\n }\r\n ]\r\n }),\r\n Ti.UI.createListSection({\r\n headerTitle:\"List Item 2\",\r\n\r\n items: [{\r\n properties: {\r\n title: \"Item 4\",\r\n canEdit: true,\r\n searchableText: \"Item 4\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 5\",\r\n canEdit: true,\r\n searchableText: \"Item 5\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 6\",\r\n canEdit: true,\r\n searchableText: \"Item 6\",\r\n }\r\n }\r\n ]\r\n })]\r\n})\r\n \r\n list.addEventListener(\"delete\", function(e){\r\n Ti.API.info(\"Deleted Row Index is is: \" +e.itemIndex);\r\n Ti.API.info(\"Deleted Section Index is is: \" +e.sectionIndex);\r\n\r\n });\r\nwin.add(list);\r\nwin.open();\r\n{code}\r\n\r\n2. \r\n\r\n\r\n{code:java}\r\n//2. Action\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'}),\r\n favoriteAction = {\r\n identifier: 'setFavorite',\r\n title: 'Favorite',\r\n style: Ti.UI.iOS.ROW_ACTION_STYLE_DEFAULT,\r\n },\r\n unfavoriteAction = {\r\n identifier: 'unsetFavorite',\r\n title: 'Unfavorite',\r\n style: Ti.UI.iOS.ROW_ACTION_STYLE_NORMAL,\r\n },\r\n deleteAction = {\r\n identifier: 'delete',\r\n title: 'Delete',\r\n style: Ti.UI.iOS.ROW_ACTION_STYLE_NORMAL,\r\n },\r\n data1 = [\r\n {properties: {canEdit: true, editActions: [favoriteAction, deleteAction], title: 'Kitten Whiskers', searchableText:'Kitten Whiskers'}},\r\n {properties: {canEdit: true, editActions: [favoriteAction, deleteAction], title: 'Copper Kettle', searchableText:'Copper Kettle'}},\r\n {properties: {canEdit: true, editActions: [favoriteAction, deleteAction], title: 'Woolen Mittens', searchableText:'Woolen Mittens'}},\r\n ],\r\n\r\n listSection1 = Ti.UI.createListSection({\r\n items: data1\r\n }),\r\n\r\n data2 = [\r\n {properties: {canEdit: true, editActions: [favoriteAction, deleteAction], title: 'Apple Strudel', searchableText:'Apple Strudel'}},\r\n {properties: {canEdit: true, editActions: [favoriteAction, deleteAction], title: 'Brown Packages', searchableText:'Brown Packages'}},\r\n {properties: {canEdit: true, editActions: [favoriteAction, deleteAction], title: 'Dog Bites', searchableText:'Dog Bites'}},\r\n {properties: {canEdit: true, editActions: [favoriteAction, deleteAction], title: 'Bee Stings', searchableText:'Bee Stings'}}\r\n ],\r\n listSection2 = Ti.UI.createListSection({\r\n items: data2\r\n }),\r\n listView = Ti.UI.createListView({\r\n top: 15,\r\n searchView: Ti.UI.createSearchBar(),\r\n dimBackgroundForSearch: false,\r\n sections: [listSection1, listSection2]\r\n });\r\n\r\n listView.addEventListener('editaction', function(e) {\r\n var item = e.section.getItemAt(e.itemIndex)\r\n if (e.identifier === 'setFavorite') {\r\n item.properties.editActions = [unfavoriteAction, deleteAction];\r\n e.section.updateItemAt(e.itemIndex, item)\r\n } else if (e.identifier === 'unsetFavorite') {\r\n item.properties.editActions = [favoriteAction, deleteAction];\r\n e.section.updateItemAt(e.itemIndex, item, { animationStyle: Ti.UI.iOS.RowAnimationStyle.BOTTOM});\r\n\r\n } else if (e.identifier === 'delete') {\r\n e.section.deleteItemsAt(e.itemIndex, 1);\r\n\r\n }\r\n});\r\n \r\nwin.add(listView);\r\nwin.open();\r\n{code}\r\n\r\n3. \r\n{code:java}\r\n//3. Edit\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white', fullscreen: true, title: 'Shopping List'});\r\nvar navWin = Ti.UI.iOS.createNavigationWindow({window: win});\r\n \r\nvar listView = Ti.UI.createListView({\r\n searchView: Ti.UI.createSearchBar(),\r\n pruneSectionsOnEdit: true,\r\n }\r\n);\r\n \r\n// Listen when items are deleted or moved\r\nfunction report (e) {\r\n Ti.API.info('Item ' + e.itemIndex + ' was ' + e.type + 'd!');\r\n}\r\nlistView.addEventListener('delete', report);\r\nlistView.addEventListener('move', report);\r\n// Left navigation button to toggle between editing and selection mode\r\nvar button = Ti.UI.createButton({title: 'Edit'});\r\nwin.leftNavButton = button;\r\nvar flag = false;\r\nbutton.addEventListener('click', function(){\r\n\r\n flag = !flag;\r\n listView.editing = flag;\r\n if (flag) {\r\n button.title = \"Stop Editing\";\r\n } else {\r\n button.title = 'Edit';\r\n }\r\n});\r\n \r\nvar sections = [];\r\nvar fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});\r\nvar fruitDataSet = [\r\n {properties: { title: 'Apple', canEdit: true, canMove: true, searchableText:'Apple'}},\r\n {properties: { title: 'Banana', canEdit: true, canMove: true, searchableText:'Banana'}}\r\n];\r\nfruitSection.setItems(fruitDataSet);\r\nsections.push(fruitSection);\r\n \r\nvar vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables'});\r\nvar vegDataSet = [\r\n {properties: { title: 'Carrots',canEdit: true, canMove: true, searchableText:'Carrots'}},\r\n {properties: { title: 'Potatoes',canEdit: true, canMove: true, searchableText:'Potatoes'}}\r\n];\r\nvegSection.setItems(vegDataSet);\r\nsections.push(vegSection);\r\n \r\nvar fishSection = Ti.UI.createListSection({ headerTitle: 'Fish'});\r\nvar fishDataSet = [\r\n {properties: { title: 'Cod',canEdit: true, canMove: true, searchableText:'Cod'}},\r\n {properties: { title: 'Haddock',canEdit: true, canMove: true, searchableText:'Haddock'}}\r\n];\r\nfishSection.setItems(fishDataSet);\r\nsections.push(fishSection);\r\n \r\nlistView.sections = sections;\r\nwin.add(listView);\r\nnavWin.open();\r\n{code}\r\n\r\n4. \r\n\r\n{code:java}\r\n// 4. Insert\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white', fullscreen: true, title: 'Shopping List'});\r\nvar navWin = Ti.UI.iOS.createNavigationWindow({window: win});\r\n \r\nvar listView = Ti.UI.createListView({\r\n searchView: Ti.UI.createSearchBar(),\r\n pruneSectionsOnEdit: true,\r\n }\r\n);\r\n \r\n// Listen when items are deleted or moved\r\nfunction report (e) {\r\n Ti.API.info('Item ' + e.itemIndex + ' was ' + e.type + 'd!');\r\n}\r\nlistView.addEventListener('delete', report);\r\nlistView.addEventListener('move', report);\r\n// Left navigation button to toggle between editing and selection mode\r\nvar button = Ti.UI.createButton({title: 'Edit'});\r\nwin.leftNavButton = button;\r\nvar flag = false;\r\nbutton.addEventListener('click', function(){\r\n\r\n flag = !flag;\r\n listView.editing = flag;\r\n if (flag) {\r\n button.title = \"Stop Editing\";\r\n } else {\r\n button.title = 'Edit';\r\n }\r\n});\r\n \r\nvar sections = [];\r\nvar fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});\r\nvar fruitDataSet = [\r\n {properties: { title: 'Apple', canInsert: true, canMove: true, searchableText:'Apple'}},\r\n {properties: { title: 'Banana', canInsert: true, canMove: true, searchableText:'Banana'}}\r\n];\r\nfruitSection.setItems(fruitDataSet);\r\nsections.push(fruitSection);\r\n \r\nvar vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables'});\r\nvar vegDataSet = [\r\n {properties: { title: 'Carrots',canInsert: true, canMove: true, searchableText:'Carrots'}},\r\n {properties: { title: 'Potatoes',canInsert: true, canMove: true, searchableText:'Potatoes'}}\r\n];\r\nvegSection.setItems(vegDataSet);\r\nsections.push(vegSection);\r\n \r\nvar fishSection = Ti.UI.createListSection({ headerTitle: 'Fish'});\r\nvar fishDataSet = [\r\n {properties: { title: 'Cod',canInsert: true, canMove: true, searchableText:'Cod'}},\r\n {properties: { title: 'Haddock',canInsert: true, canMove: true, searchableText:'Haddock'}}\r\n];\r\nfishSection.setItems(fishDataSet);\r\nsections.push(fishSection);\r\n \r\nlistView.sections = sections;\r\n\r\nlistView.addEventListener('insert', function(e) {\r\n var item = e.section.getItemAt(e.itemIndex);\r\n e.section.insertItemsAt(e.itemIndex, [item]);\r\n\r\n});\r\nwin.add(listView);\r\nnavWin.open();\r\n\r\n{code}\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-19T08:50:39.000+0000", "updated": "2017-07-19T08:50:39.000+0000" }, { "id": "426526", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Backported PR (6_2_X) : https://github.com/appcelerator/titanium_mobile/pull/9303", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-11T07:44:22.000+0000", "updated": "2017-08-11T07:44:22.000+0000" }, { "id": "426677", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nAble to perform edit/delete actions on search results for ListViews and TableViews using searchbars", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-08-15T15:28:08.000+0000", "updated": "2017-08-15T15:28:08.000+0000" }, { "id": "426903", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified in builds SDK 6.2.0.v20170816173122 & 7.0.0.v20170818091652", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-08-18T17:20:24.000+0000", "updated": "2017-08-18T17:20:24.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }