// JavaScript Document //璺宠浆鍒版寚瀹氶〉. var pForm; var actionStr; function goCustomPage(currentPage, totalPage){ var cusPageTxt = pForm.customPageTxt; if (trim(cusPageTxt.value) == ''){ alert("璇疯緭鍏ラ〉鍙�"); cusPageTxt.focus(); return; } if (trim(cusPageTxt.value).match("^\\d+$") == null){ alert("璇疯緭鍏ユ暟瀛�"); return; } if (parseInt(cusPageTxt.value) > parseInt(totalPage) ){ cusPageTxt.value = totalPage; } var targetURL =actionStr + '&pageMethod=custom¤tPage=' + currentPage + '&customPage=' ; // document.location=targetURL + cusPageTxt.value; pageSubmit(targetURL + cusPageTxt.value); } //璁剧疆姣忛〉琛屾暟 function setPageSize(currentPage, totalRows){ var targetURL = actionStr + '&pageMethod=custom¤tPage=' + currentPage + '&pageSize=' ; var pageSize = document.all.pageSizeTxt; if (trim(pageSize.value) == ''){ alert("璇疯緭鍏ヨ鏁�"); pageSize.focus(); return; } if (pageSize.value <= 0 ) { alert("琛屾暟蹇呴』澶т簬锛愶紝璇烽噸鏂拌緭鍏ワ紒"); pageSize.focus(); pageSize.select(); return; } if (trim(pageSize.value).match("^\\d+$") == null){ alert("璇疯緭鍏ユ暟瀛�"); return; } if (parseInt(pageSize.value) > parseInt(totalRows) ){ pageSize.value = totalRows; } pageSubmit(targetURL + pageSize.value); } var tempsint=true; //鎷兼帴URL瀛楃涓�. function pageAction (pageMethod,currentPage){ if(!tempsint){ alert("璇峰嬁棰戠箒鐐瑰嚮锛�"); tempsint=true; return; } if(document.getElementById("edit")){ document.getElementById("edit").value=""; } if(document.getElementById("cardstate")){ document.getElementById("cardstate").value=""; } var targetURL = actionStr + "&pageMethod="+pageMethod+ "¤tPage=" + currentPage; pageSubmit(targetURL); tempsint=false; } //鎻愪氦鍒癮ction,鏀寔浣跨敤form鎻愪氦. function pageSubmit(targetURL){ if (typeof(pForm) == 'undefined' ){ document.location = targetURL; }else { pForm.action=targetURL; pForm.submit(); } } function setExpandIf(inner_HTML){ var expSpan = document.all.expandIf; if (expSpan){ expSpan.innerHTML = inner_HTML; } } function getPageSize(){ return pForm.pageSizeTxt.value; } function getCustomPage(){ return pForm.customPageTxt.value; } function getPageSizeActionStr(){ return "&pageSize=" + getPageSize(); } function getCustomPageActionStr(){ return "&pageSize=" + getCustomPage(); } function setPform(form){ pForm = form; } function setActionStr(url){ actionStr = url; } function trim(s){ s=s.replace( /^[" "|"銆�"]*/, ""); s=s.replace( /[" "|"銆�"]*$/, ""); s=s.replace(/^\s+|\s+$/g,""); return s; }