{ "id": "60716", "key": "TIMOB-84", "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": [ { "id": "11213", "name": "Release 0.7.0", "archived": true, "released": true, "releaseDate": "2009-10-05" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:51:55.000+0000", "created": "2011-04-15T02:23:29.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "feature", "ios", "iphone" ], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:51:55.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": "{html}

Description

\n

The purpose of this API is to create native pickers. We will\nsupport four APIs:

\n

Titanium.UI.createDatePicker

\n

Titanium.UI.createPicker

\n

Titanium.UI.createModalDatePicker

\n

Titanium.UI.createModalPicker

\n

Date Picker

\n
\n\n// create date picker\nvar datePicker = Titanium.UI.createDatePicker({\n    id:htmlElementId\n    value:value, \n    mode:mode, \n    maxDate:maxDate, \n    minDate:minDate, \n    minuteInterval:interval, \n});\n\n// add change listener for date picker\ndatePicker.addEventListener('change', function(e)\n{\n    e.value // date value (should be a properly constructed JS Date Object)\n});\n\n// set date value\ndatePicker.setValue(new Date(), {animated:true});\n
\n

API Arguments

\n

id : the location of where the date picker\nshould appear. If not specified, it should appear in the default\nlocation (bottom, I believe)

\n

value : initially selected date. Should be a JS\nDate object.

\n

mode : iPhone supports the following modes:\nTitanium.UI.DatePicker.MODE_TIME, Titanium.UI.DatePicker.DATE,\nTitanium.UI.DatePicker.MODE_DATE_AND_TIME

\n

minDate : optional. the minimum date in the\npicker. should be a JS Date object

\n

maxDate : optional. the maximum date in the\npicker - should be a JS Date object

\n

minuteInterval : You can use this property to\nset the interval displayed by the minutes wheel (for example, 15\nminutes). The interval value must be evenly divided into 60; if it\nis not, the default value is used. The default and minimum values\nare 1; the maximum value is 30.

\n

Picker

\n
\n\n// create multi-dimensional array for data (also supports selected attribute for initial value)\nvar data = [];\n\n// support title attribute\nvar col1 = [\n    {title:'foo', selected:true},\n    {title:'bar'}\n];\n\n// support html attribute (also supports selected attribute for initial value)\nvar col2 = [\n    {html:'<div><img src=\"foo.png\"/> pick me</div>', selected:true},\n    {html:'<div><img src=\"bar.png\"/> pick me too</div>'}\n];\n\n// add columns to array\ndata.push(col1);\ndata.push(col2);\n\n// create date picker\nvar picker = Titanium.UI.createPicker({\n    id:htmlElementId,\n    data:data, \n    showSelectionIndicator:true\n });\n\n// add change listener for date picker\npicker.addEventListener('change', function(e)\n{\n    e.column // the column of the new value\n    e.row // the row of the new value\n    e.selectedValue[0] // current value of the selected row - col 1\n    e.selectedValue[1] // current value of the selected row - col 2 (this would be valid for the # of available columns)\n});\n\n\n// set data for a particular colunm\npicker.setColumnData(col,data);\n\n// set data for entire picker\npicker.setData(data);\n\n// get the current value of first column\nvar val = picker.getSelectedRow(col);  // returns index of selected value of first column's array\n\n// select a row\npicker.selectRow(row,col,{animated:true});\n
\n

API Arguments

\n

id : the location of where the picker should\nappear. If not specified, it should appear in the default location\n(bottom, I believe)

\n

data : multi-dimensional array of data for the\npicker.

\n

showSelectionIndicator : optional. default is\ntrue. determines whether selected indicator is visible (may be\niPhone only)

\n

Modal Pickers

\n

createModalPicker and createModalDatePicker will be the same\nwith the following exceptions:

\n
{html}", "attachment": [], "flagged": false, "summary": "API - Pickers", "creator": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "122747", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Okay, nonmodal pickers are implemented. Clarification re: modal\npickers:

\n

When a tab view is visible, do the modal pickers obscure the\ntabs (like a keyboard) or stay above it (like a tool bar)?

{html}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:23:29.000+0000", "updated": "2011-04-15T02:23:29.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }