화면에서 페이지 매김을하기 위해 Grails 2.0과 함께 ExtJS 3.3.1을 사용하고 있지만 예상대로 작동하지 않습니다. pagingToolbar가 Grails extJS grid paging
JS 페이지Grails ExtJS 페이지 매김
paramNames: {start:'offset',limit:'max',sort:'sort',dir:'order'},
baseParams: {offset:0,max:10},
을 :
this.gridBBar = new Ext.PagingToolbar({
pageSize : 10,
store : this.gridStore,
displayInfo : true,
displayMsg : 'Hiển thị {0} - {1} mục tìm được của {2} kết quả',
emptyMsg : 'Không tìm thấy dữ liệu',
});
컨트롤러 :
def result = Floor.createCriteria().list(
max:params.int('max')?:100,
offset:params.int('offset')?:0
)
render ([count:result.totalCount,data:result] as JSON)
하지만 호출 버튼 (NEXT)이 때문에 중지 된 난 선단 여기 등록한 뒤에 저장소에는 방금 검색 한 10 개 항목 만 포함되었습니다.
는 내가 10 오프셋 변경 :
paramNames: {start:'offset',limit:'max',sort:'sort',dir:'order'},
baseParams: {offset:10,max:10},
매김이 잘 작동되고, 하나 개 이상한 것은 제외 : 제 1 회 클릭, 20 월 30 일 레코드에 대한 그리드는 항상 다음 10 개 결과를 표시합니다 (10 - 20 기록 2), 현재 첫 10 결과가 아닙니다. ExtJs와 Grails에서 결합 된 페이지 매김의 올바른 사용법은 무엇인지 모르겠습니다. 이 문제에 경험이 있다면, 나에게 몇 가지 정보를 나눠 주시겠습니까?
정말 고마워요.
json은 어떤 모습입니까? http://shitmores.blogspot.com/2007/04/grails-ext-grid-mini-tutorial.html – chrislovecnm
반환 된 JSON은 { "count": 10, "items": [ { "id": 1, "name": "AA"}, { "id": 2, "name": "B"}}}. 반환 목록에 getTotalCount() 메서드 또는 totalCount 속성이 없기 때문에 render ([count : result.totalCount, data : result] JSON) 문이 올바르지 않습니다. –