Bootstrap 테이블을 사용하는 법을 배울 때, 친구의 도움으로 클라이언트를 신청할 때, 나는 문서 http://bootstrap-table.wenzhixin.net.cn/examples/를 찾았습니다.
배경으로 전달되는 페이지 당 페이지 수가 발견되고 레코드 수는 오프셋이 시작됩니다.
캡슐화를 시작하고, 내 코드를 공유하고, 부트 스트랩 테이블에서 페이지 번호와 페이지 번호를 가져 와서 처리를 위해 배경으로 넘겨줍니다.
$ ( '#table'). 부트 스트랩 가능 ({url : '<%= path%>/feedlist.cqzk', Striped : True, Pagination : True, PageList : [3,5,20], pageize : 3, pagenumber : 1, 'server', // 서버-사이드 페이지 매니 네이션 컬럼 : [필드 : ','제목 ',', ','{제목 ','제목 ' 제목 : 'time'}]}); @RequestMapping (value = "/feedlist.cqzk") @ResponseBody Public String URL_AD1 (httpservletRequest 요청, BootPage Page)은 servletexception, ioException, runtimeexception {@suppressWarnings ( "Cheecked")를 던졌습니다. BootPage Pager = FeedbackDao.getBypage ( "피드백", 페이지, NULL); System.out.println ((JsonArray.fromObject (Pager)). getString (0) .toString ()); return (jsonarray.fromobject (Pager)). getString (0) .toString (); // getString (0)을 쓰지 않으면 추가 브래킷이 있고 반환 된 배열이 하나이며, 쓰면 첫 번째 개체를 반환합니다. } public bootpage getBypage (String HQL, BootPage Peager, Map <String, Object> Condition) {if (Peager == NULL) {New New OrgalArgumentException ( "페이지가 비어있을 수 없습니다!"); } query q = sessionFactory.getCurrentSession (). Createquery (HQL); Q.SetFirstResult (Pager.GetOffset ()); Q.SetMaxResults (Pager.GetLimit ()); if (조건! = null) {q.setProperties (조건); } pager.setrows (q.list ()); Pager.setTotal (this.countall (HQL, Condition)); 리턴 호출기; . } 문자열 tmphql = hql.tolowercase (); String regex = hql.substring (0, tmphql.indexof ( "from")); HQL = HQL.ReplaceFirst (Regex, "Select Count (*)"); query q = sessionFactory.getCurrentSession (). Createquery (HQL); if (조건! = null) {q.setProperties (조건); } return (long) q.uniqueresult (); } public final class bootpage <t> {보호 된 긴 총; 보호 목록 <t> 행; 보호 된 int 한계 = 0; 보호 된 int 오프셋 = 0; 보호 된 문자열 주문 = "ASC";여전히 심도있게 공부하고 싶다면 여기를 클릭하여 3 가지 흥미로운 주제를 공부하고 첨부 할 수 있습니다.
부트 스트랩 학습 튜토리얼
부트 스트랩 실용 튜토리얼
부트 스트랩 플러그인 사용 튜토리얼
위는 부트 스트랩 테이블의 사용 방법입니다. 부트 스트랩 테이블의 사용 방법을 마스터하는 것이 도움이되기를 바랍니다.