Apple Dashcode를 사용하여 모바일 웹 앱을 구성하려고합니다.Dashcode 모바일 웹 앱 동적 목록 행 라벨링
둥근 사각형 목록을 사용자의 메뉴 인터페이스로 사용하고 싶지만 동적 목록에서 다양한 행의 레이블을 변경할 수 없습니다. 여기
내 목록에 대한 자바 스크립트입니다 :var dayController = {
/* categoryList will display these items */
_rowData: ["iPods", "Macs", "Applications"],
/* categoryListController must implement the numberOfRows and prepareRow functions */
/* This method is used to find out how many rows should be in the list */
numberOfRows: function() {
return this._rowData.length;
},
/* categoryList calls this method once for every row. */
prepareRow: function(rowElement, rowIndex, templateElements) {
/*
templateElements contains references to all elements that have an id in the category template row.
We use the lines below to update the list with each category item in _rowData.
*/
if (templateElements.categoryLabel) {
templateElements.categoryLabel.innerText = this._rowData[rowIndex];
}
/* Assign an onclick handler that will cause the browser to go a page
showing all products related to this category item, when clicked
*/
var self = this;
var handler = function() {
/* Get the category item associated with this row */
var category = self._rowData[rowIndex];
};
rowElement.onclick = handler;
}
};
목록의 행에 대한 레이블로 rowData []를 할당 할 수 있기를 원하지만 작동하지 않을 수 있습니다.
난 prepareRow 함수로 뭔가를 바꿀 필요가 있다고 생각하니?
Dashcode와 함께 JQuery를 사용하여 웹 앱을 성공적으로 만들었습니까? 아마도 이것이 더 나은 접근 방법 일 것입니다.