1. 程式人生 > >DWZ tab選項卡共用頁面分頁元件重新整理不起作用、失效問題

DWZ tab選項卡共用頁面分頁元件重新整理不起作用、失效問題

初用DWX,還是碰到好多問題,謹以此文記錄tab 分頁重新整理問題。

HTML頁面

tab頁面:

注:這兒id不能省略

列表頁面:

注:id為固定的 pagerForm    rel為tab頁面中的id值

page頁面:

<div th:include="views/common/pager_local :: tab"></div>

pager_local.html

<th:block th:fragment="tab">
	<div class="panelBar"  th:online="text">
		<div class="pages">
			<span th:text="#{TEXT_DISPLAY}">display</span>
			<select class="combox" name="numPerPage" th:onchange="'javascript:tabPageBreak('+'{numPerPage:'+this.value+'}'+','+${tabTagId}+');'">
				<option value="20"  th:selected="${infos.numPerPage}  == 20 ? 'selected' "  >20</option>
				<option value="50"  th:selected="${infos.numPerPage}  == 50 ? 'selected' ">50</option>
				<option value="100" th:selected="${infos.numPerPage}  == 100 ? 'selected' " >100</option>
				<option value="200" th:selected="${infos.numPerPage}  == 200 ? 'selected' " >200</option>
			</select>
			<span><span th:text="#{TEXT_ITEMS}">items</span> <span>&nbsp;,&nbsp;</span><span th:text="#{TEXT_TOTAL}">total</span><span><label style="color:blue;">&nbsp;[[${infos.totalCount}]]&nbsp;</label></span><span th:text="#{TEXT_ITEMS}">items</span></span>
		</div>
		<div class="pagination"  targetType="navTab" th:rel="${tabTagId}" th:attr="totalCount=${infos.totalCount},numPerPage=${infos.numPerPage},currentPage=${infos.pageNum}"   pageNumShown="10" ></div>
	</div>
</th:block>

注:tabTagId 為 tab中的id值

function tabPageBreak(args, div){
    var tabpage = $(div).attr("id");
    dwzPageBreak({targetType:"navTab", rel:tabpage, data:args});
}

注:這兒的 div 獲取到的是 id為 div 的整個標籤