{ "id": "122229", "key": "AC-2697", "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": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2014-06-30T07:30:48.000+0000", "created": "2013-11-08T11:28:23.000+0000", "labels": [ "alloy", "arguments" ], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:41:48.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": "14544", "name": "Alloy", "description": "Please enter tickets related to the Alloy here." } ], "description": "Hi there,\r\n\r\nI wish to set-up custom binding logic for a widget using as much standard TiAPI principles as possible.\r\n\r\nI have the following XML:\r\n\r\nviews/scheduler.xml\r\n{code:xml}\r\n\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nIn my widget's controller I have the following (lazy) tests:\r\n\r\nwidgets/uk.co.mycompany.scheduler/controllers/widget.js\r\n{code:javascript}\r\nvar args = arguments[0] || {};\r\nargs['dataCollection'] || Alloy.Globals.Log.error('[FAIL] dataCollection required parameter');\r\nargs['dataFilter'] || Alloy.Globals.Log.error('[FAIL] dataFilter required parameter');\r\nargs['dataTransform'] || Alloy.Globals.Log.error('[FAIL] dataTransform required parameter');\r\n{code}\r\n\r\nWhen I run the code, only dataTransform is present in the arguments object.\r\n\r\nI have tested in a variety of scenarios, also using the tag. The results were always the same.\r\n\r\nLee.", "attachment": [], "flagged": false, "summary": "Setting dataCollection or dataFilter on a Ti.UI.View via or doesn't work", "creator": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "environment": "Titanium SDK 3.1.3.GA\r\nAlloy 1.2.2\r\n---------------------\r\nCrunchbang 7", "comment": { "comments": [ { "id": "280455", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello Lee! \r\n\r\nCan you please help us with a complete test case? Currently your test case fails because there is no model. \r\n\r\nBest,\r\n\r\nMauro ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-21T01:33:07.000+0000", "updated": "2013-11-21T01:33:07.000+0000" }, { "id": "280519", "author": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "body": "Hi Mauro !\n\nApologies for that - here's is the model file\n\nWhat else do you need?\n\nmodels/job.js\n{code:javascript}\nvar moment = require('alloy/moment');\n\nexports.definition = {\n config : {\n columns : {\n 'jobID' : 'TEXT',\n 'description' : 'TEXT',\n 'location' : 'TEXT',\n 'startTime' : 'TEXT',\n 'endTime' : 'TEXT',\n 'story' : 'BLOB'\n },\n adapter : {\n idAttribute : 'jobId',\n type : Ti.Platform.name == 'mobileweb' ? 'localStorage' : 'sql',\n db_name : 'jobs',\n collection_name : 'job'\n }\n },\n extendModel : function(Model) {\n if (Model && Model.prototype) {\n _.extend(Model.prototype, {\n // extended functions and properties go here\n });\n }\n\n return Model;\n },\n extendCollection : function(Collection) {\n if (Collection && Collection.prototype) {\n _.extend(Collection.prototype, {\n getByWeek : function(weekStart) {\n\n var weekEnd = moment(weekStart).add('d', 7),\n sqlQuery,\n results;\n\n sqlQuery = ' \\\n SELECT * FROM job \\\n WHERE startTime \\\n BETWEEN ' + weekStart + ' AND ' + weekEnd + '\\\n OR endTime \\\n BETWEEN ' + weekStart + ' AND ' + weekEnd;\n\n results = this.fetch({\n query : sqlQuery\n });\n\n if (results) {\n Ti.API.info('Requested jobs found: ' + results);\n } else {\n Ti.API.info('No jobs found: ' + results);\n }\n\n return results;\n }\n // extended functions and properties go here\n });\n }\n\n return Collection;\n }\n}; \n{code}", "updateAuthor": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "created": "2013-11-21T10:50:58.000+0000", "updated": "2013-11-21T10:50:58.000+0000" }, { "id": "282300", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello Lee,\nwe will need the widget as well, so we can test exactly the same code than you.\n\nBest,\nMauro ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-12-04T00:17:02.000+0000", "updated": "2013-12-04T00:17:02.000+0000" }, { "id": "311578", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "We didn't get a response from customer. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-06-30T07:30:48.000+0000", "updated": "2014-06-30T07:30:48.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }