PageSourceSearch

https://occtonet3.occto.or.jp/public/dfw/RP11/OCCTO/sdCommon/jsp/js/sdPaging.js

js occto.or.jp collected 2026-10-02 04:39:33 UTC 7,274 bytes, 264 lines download raw bytes

1var sdPaging = new Object();
2
3/**
4 * 明細テーブルのajaxページ遷移制御クラス
5 * @param tableName 対象となる明細テーブルの名称
6 */
7sdPaging.ajaxPagingSupport = function(tableName) {
8	this.tableName = tableName;
9	this.serializeTarget = '#mainForm';
10	this.callBackContext = new sdAjax.callBackContext();
11};
12
13	/**
14	 * 明細テーブルのページ遷移処理
15	 * @param startIndex 遷移後に表示する開始行のIndex
16	 */
17	sdPaging.ajaxPagingSupport.prototype.pageMove = function (startIndex) {
18		var elmId = this.tableName + '_' + 'nextPageStartIndex';
19
20		$('#' + elmId).val(startIndex);
21		$('#fwExtention_pagingTargetTable').val(this.tableName);
22		common.setAction('reference', 'pageMove');
23
24		var targetUrl = $(this.serializeTarget).attr('action');
25		var paramObj =  $(this.serializeTarget).serialize();
26		sdAjax.sendRequest(targetUrl, this.callBackContext, paramObj, this.tableName);
27		sdAjax.nowSending[this.tableName] = true;
28	};
29
30	/**
31	 * 明細テーブルの次ページへのページ遷移処理
32	 */
33	sdPaging.ajaxPagingSupport.prototype.pageMoveNext = function () {
34		var elmId = this.tableName + '_' + 'currentPage';
35		var cp = parseInt($('#' + elmId).val());
36		elmId = this.tableName + '_' + 'dispRowNum';
37		var rn = parseInt($('#' + elmId).val());
38		this.pageMove((cp * rn) + 1);
39	};
40
41	/**
42	 * 明細テーブルの前ページへのページ遷移処理
43	 * @param tableName 対象となる明細テーブルの名称
44	 */
45	sdPaging.ajaxPagingSupport.prototype.pageMovePrevious = function () {
46		var elmId = this.tableName + '_' + 'currentPage';
47		var cp = parseInt($('#' + elmId).val());
48		elmId = this.tableName + "_" + 'dispRowNum';
49		var rn = parseInt($('#' + elmId).val());
50
51		this.pageMove((cp-2) * rn + 1);
52	};
53
54	/**
55	 * 明細テーブルの先頭ページへのページ遷移処理
56	 */
57	sdPaging.ajaxPagingSupport.prototype.pageMoveFirst = function () {
58		this.pageMove(1);
59	};
60
61	/**
62	 * 明細テーブルの最終ページへのページ遷移処理
63	 */
64	sdPaging.ajaxPagingSupport.prototype.pageMoveLast = function () {
65		var elmId = this.tableName + '_' + 'totalPage';
66		var cp = parseInt($('#' + elmId).val());
67		elmId = this.tableName + '_' + 'dispRowNum';
68		var rn = parseInt($('#' + elmId).val());
69		this.pageMove((cp-1) * rn + 1);
70	};
71
72
73
74/**
75 * Ajaxの処理など、名細部にフリックが発生したときの処理を管理するクラス
76 * @param pagingCtl	sdPaging.ajaxPagingSupport
77 * @param divsionSelector	明細部のSelector
78 * @returns {flickController}
79 */
80sdPaging.flickController = function(pagingCtl, divsionSelector) {
81	this.paging = pagingCtl;
82	this.targetTable = pagingCtl.tableName;
83	this.funcId = null;
84	this.targetSelector = divsionSelector;
85	this.onHide = function(){};
86	this.onShow = function(){};
87	/**
88	 * (通信)処理中かどうか
89	 */
90	this.processing = false;
91
92};
93	/**
94	 * フリック発生時のイベントシンク
95	 * @param	moveTo:フリックの方向
96	 */
97	sdPaging.flickController.prototype.flick = function(moveTo) {
98		this.direction = moveTo;
99		if (this.direction == 'left') {
100			this.paging.pageMoveNext();
101			$(this.targetSelector).hide({
102				effect : "slide",
103				direction : "left",
104				callback:this.onHide
105			});
106
107		} else if (this.direction == 'right') {
108			this.paging.pageMovePrevious();
109			$(this.targetSelector).hide({
110				effect : "slide",
111				direction : "right",
112				callback : this.onHide
113			});
114		}
115
116		this.processing = true;
117		var thisDummy = this;
118		this.funcId = setTimeout(
119			function(){
120				thisDummy.show();
121			},
122			500
123		);
124	};
125
126	/**
127	 * 受信後の描画処理
128	 */
129	sdPaging.flickController.prototype.show = function() {
130		if (this.processing) {
131			//通信中に当該メソッドが呼ばれる場合、タイマを再設定してReturn
132			var thisDummy = this;
133			this.funcId = setTimeout(
134				function(){
135					thisDummy.show();
136				},
137				50
138			);
139			return;
140		} else {
141			clearTimeout(this.funcId);
142		}
143		if (this.direction == 'left') {
144			$(this.targetSelector).show({
145				effect : "slide",
146				direction : "right",
147				callback:this.onShow
148			});
149		} else if (this.direction == 'right') {
150			$(this.targetSelector).show({
151				effect:"slide",
152				direction:"left",
153				callback:this.onShow
154			});
155		}
156	};
157
158	/**
159	 * エラー発生時の描画回復処理
160	 */
161	sdPaging.flickController.prototype.restore = function() {
162		if (this.direction == 'left') {
163			$(this.targetSelector).show({
164				effect:"slide",
165				direction:"left",
166				callback:this.onShow
167			});
168		} else if (this.direction == 'right') {
169			$(this.targetSelector).show({
170				effect:"slide",
171				direction:"right",
172				callback:this.onShow
173			});
174		}
175	};
176
177
178/**
179 * 明細テーブルのページ遷移処理
180 * @param tableName 対象となる明細テーブルの名称
181 * @param startIndex 遷移後に表示する開始行のIndex
182 */
183sdPaging.pageMove = function (tableName, startIndex) {
184	var elmId = tableName + '_' + 'nextPageStartIndex';
185
186	$('#' + elmId).val(startIndex);
187	$('#FwExtention_PagingTargetTable').val(tableName);
188	common.setAction('reference', 'pageMove');
189	$('#mainForm').submit();
190};
191
192/**
193 * 明細テーブルの次ページへのページ遷移処理
194 * @param tableName 対象となる明細テーブルの名称
195 */
196sdPaging.pageMoveNext = function (tableName) {
197	var elmId = tableName + '_' + 'currentPage';
198	var cp = parseInt($('#' + elmId).val());
199	elmId = tableName + '_' + 'dispRowNum';
200	var rn = parseInt($('#' + elmId).val());
201
202	sdPaging.pageMove(tableName, ((cp * rn) + 1));
203};
204
205/**
206 * 明細テーブルの前ページへのページ遷移処理
207 * @param tableName 対象となる明細テーブルの名称
208 */
209sdPaging.pageMovePrevious = function (tableName) {
210	var elmId = tableName + '_' + 'currentPage';
211	var cp = parseInt($('#' + elmId).val());
212	elmId = tableName + '_' + 'dispRowNum';
213	var rn = parseInt($('#' + elmId).val());
214
215	sdPaging.pageMove(tableName, (cp-2) * rn + 1);
216};
217
218/**
219 * 明細テーブルの先頭ページへのページ遷移処理
220 */
221sdPaging.pageMoveFirst = function (tableName) {
222	sdPaging.pageMove(tableName, 1);
223};
224
225/**
226 * 明細テーブルの最終ページへのページ遷移処理
227 */
228sdPaging.pageMoveLast = function (tableName) {
229	var elmId = tableName + '_' + 'totalPage';
230	var cp = parseInt($('#' + elmId).val());
231	elmId = tableName + '_' + 'dispRowNum';
232	var rn = parseInt($('#' + elmId).val());
233	sdPaging.pageMove(tableName, (cp-1) * rn + 1);
234};
235
236/**
237 * 次頁への移動可否
238 */
239sdPaging.isAbleMoveNext = function(tableName) {
240	var elmId = tableName + '_' + 'currentPage';
241	var cp = parseInt($('#' + elmId).val());
242
243	elmId = tableName + '_' + 'totalPage';
244	var tp = parseInt($('#' + elmId).val());
245
246	if (cp < tp) {
247		return true;
248	}else{
249		return false;
250	}
251};
252/**
253 * 前頁への移動可否
254 */
255sdPaging.isAbleMovePrevious = function(tableName) {
256	var elmId = tableName + '_' + 'currentPage';
257	var cp = parseInt($('#' + elmId).val());
258
259	if (1 < cp) {
260		return true;
261	}else{
262		return false;
263	}
264};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.