2010-08-17 2 views
0

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를 사용하여 웹 앱을 성공적으로 만들었습니까? 아마도 이것이 더 나은 접근 방법 일 것입니다.

답변

0

Erm은 자바 스크립트가 아닌 둥근 사각형을 설정하겠습니까?

Dashcode를 사용하여 웹 앱을 만들 수 있지만 실제로는 요즘에는 다른 대안이 있습니다. 그러나 이것을 수행하기 위해 JQuery 위에 구축 된 JQTouch라는 JS 프레임 워크가있었습니다. JQTouch는 이제 Extjs에 포함되었으며 모두 이름을 바꿉니다. Sechcha Touch. 나는 좀 더 유연한 대안으로 그걸 보길 권한다.

Dashcode는 Mac 위젯 제작에 적합하지만 웹 기반 iPxx 응용 프로그램에는 훨씬 더 제한적입니다.