{ "id": "109968", "key": "TIMOB-12872", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": [], "resolution": null, "resolutiondate": null, "created": "2013-02-21T09:35:20.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "appendrow", "imageView", "rows", "setdata", "tableView" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:49.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "My project requirements were to create multiple views, each containing a table. The first view contains all the data from all tables and other views contain their specific data only.*If you add another view to a row, the whole view appears only in one table and completely disappears in second table*. Below is the code for sample project i made, note that the properties icon is not visible in second view even when the data is same.\r\n\r\n*app.js*\r\n{code:javascript}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar self=Ti.UI.createWindow({\r\n\ttop:0,\r\n\tleft:0,\r\n\tright:0,\r\n\tbottom:0,\r\n\tbackgroundColor: \"#525252\",\r\n\tmodal: true,\r\n\ttitle: \"Demo Tables\"\r\n})\r\n\r\nvar closeBtn= Ti.UI.createButton({\r\n\ttitle: \"Back\"\r\n});\r\ncloseBtn.addEventListener(\"click\",function(){\r\n\tself.title=\"Demo Tables\";\r\n\tfirstView.hide();\r\n\tsecondView.hide();\r\n});\r\nself.setLeftNavButton(closeBtn);\r\n\r\n\r\nvar addBtn=Ti.UI.createButton({\r\n\twidth: \"150dp\",\r\n\ttop: \"50dp\",\r\n\theight: \"50dp\",\r\n\ttitle: \"Add more data\"\r\n})\r\nself.add(addBtn);\r\n\r\n\r\n\r\nvar openFirstView=Ti.UI.createButton({\r\n\twidth: \"150dp\",\r\n\ttop: \"150dp\",\r\n\theight: \"50dp\",\r\n\ttitle: \"open All Data\"\r\n});\r\nopenFirstView.addEventListener(\"click\",function(){\r\n\tself.title=\"First View\";\r\n\tcloseBtn.show();\r\n\tfirstView.show();\r\n});\r\n\r\nself.add(openFirstView);\r\n\r\n\r\nvar openSecondView=Ti.UI.createButton({\r\n\twidth: \"150dp\",\r\n\ttop: \"250dp\",\r\n\theight: \"50dp\",\r\n\ttitle: \"open first data\"\r\n});\r\nopenSecondView.addEventListener(\"click\",function(){\r\n\tself.title=\"Second View\";\r\n\tcloseBtn.show();\r\n\tsecondView.show();\r\n});\r\nself.add(openSecondView);\r\n\r\n\r\nvar firstView=require(\"/childView\").createChildView();\r\nself.add(firstView);\r\nfirstView.hide();\r\n\r\n\r\nvar secondView=require(\"/childView\").createChildView();\r\nself.add(secondView);\r\nsecondView.hide();\r\n\r\nvar sampleData=require(\"/childView\").createtableData();\r\nfirstView.table.setData(sampleData);\r\nsecondView.table.appendRow(sampleData);\r\n\r\nself.open();\r\n\r\n{code}\r\n\r\n*ChildView.js*\r\n{code:javascript}\r\nexports.createChildView=function(){\r\n\tvar self=Ti.UI.createView({\r\n\t\twidth: \"100%\",\r\n\t\theight: \"100%\",\r\n\t\tbackgroundColor: \"transparent\",\r\n\t});\r\n\t\r\n\tvar table=Ti.UI.createTableView({\r\n\t\tminRowHeight: \"45dp\",\r\n\t\theight: \"95%\",\r\n\t\twidth: \"95%\",\r\n\t\tstyle: Ti.UI.iPhone.TableViewStyle.PLAIN\r\n\t})\r\n\tself.add(table);\r\n\tself.table=table;\r\n\t\r\n\treturn self;\r\n}\r\n\r\nexports.createtableData=function(){\r\n\tvar data=[];\r\n\r\n\tvar row1=Ti.UI.createTableViewRow({title: \"first row\", backgroundColor: \"white\"});\r\n\trow1.add(exports.createPropertiesIcon());\r\n\t\r\n\tvar row2=Ti.UI.createTableViewRow({title: \"second row\", backgroundColor: \"gray\"});\r\n\trow2.add(exports.createPropertiesIcon());\r\n\t\r\n\tdata.push(row1);\r\n\tdata.push(row2);\r\n\treturn data;\r\n}\r\nexports.createPropertiesIcon=function(){\r\n\tvar self=Ti.UI.createImageView({\r\n\t\timage : '/properties_icon.png',\r\n\t\tright : '8dp', \r\n\t\t//top: '50dp', \r\n\t\theight:'50dp',\r\n\t\twidth:'50dp'\r\n\t});\r\n\tself.addEventListener(\"click\",function(){\r\n\t\talert(\"hello\");\r\n\t});\r\n\t\r\n\treturn self;\r\n}\r\n{code}\r\n", "attachment": [ { "id": "35661", "filename": "Screen Shot 2013-02-21 at 3.00.42 PM.png", "author": { "name": "ankush3003", "key": "ankush3003", "displayName": "ankush gulati", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-02-21T09:35:20.000+0000", "size": 24462, "mimeType": "image/png" }, { "id": "35662", "filename": "Screen Shot 2013-02-21 at 3.00.54 PM.png", "author": { "name": "ankush3003", "key": "ankush3003", "displayName": "ankush gulati", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-02-21T09:35:20.000+0000", "size": 20215, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: adding same rows array to multiple tables results in layout issues if rows contain other view like image etc.", "creator": { "name": "ankush3003", "key": "ankush3003", "displayName": "ankush gulati", "active": true, "timeZone": "Asia/Kolkata" }, "subtasks": [], "reporter": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium sdk 2.1.4.GA + , even in latest release, mac version 10.7.5, on iOS", "comment": { "comments": [ { "id": "254896", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes this is still happening on 3.2 CI", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-30T18:14:44.000+0000", "updated": "2013-05-30T18:14:44.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }