Dashcode でプロジェクトを作成し、リスト コントロールを挿入し、動的リストを有効にし、JSON オブジェクトを作成してコントロールに関連付けました。コードは次のようになります...
var stations = {
_rowData: ["Mitchelton", "Gaythorne", "Albion", "Central",
"Burpengary", "Petrie", "Morayfield", "Caboolture", "Ferny Grove"],
numberOfRows: function() { return this._rowData.length; },
prepareRow: function(rowElement, rowIndex, templateElements) {
if (templateElements.label) {
templateElements.label.innerText = this._rowData[rowIndex];
}
rowElement.onclick = function(event) { alert("Row "+rowIndex); };
}
ご覧のとおり、アイテムが選択されるとrowIndexが出力されますが、そのインデックスに実際の値を表示したいと思います。
残念ながら、これ(たとえば)「this._rowData[2]」は機能しません。「_rowData」オブジェクトを見つけることができないようです。