瀏覽代碼

오름차순 정리

whakdo963 2 年之前
父節點
當前提交
41d2910ba1

+ 37 - 0
src/main/webapp/js/app/loanmng/ITP_LOANMNG01010.js

@@ -386,6 +386,43 @@ let listObj = {
386 386
 					$.each(ids, function(idx, rowId) {
387 387
 						$(LOANMNG01010_GRID_ID).jqGrid('setCell', rowId, 'loanDvsnNm', '', ITP_GRID_COL_STYLE.link);
388 388
 					});
389
+					const self=this;
390
+					if(self.sortUse) return;
391
+					self.sortUse=true;
392
+					$(LOANMNG01010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').css('cursor','default');
393
+					$(LOANMNG01010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(4).css('cursor','pointer');
394
+					$(LOANMNG01010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(5).css('cursor','pointer');
395
+					$(LOANMNG01010_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
396
+						const idx=$(this).index();
397
+						console.log("xxxx grid header click xxxxxxx index=="+idx, param );
398
+						if(idx==4 || idx==5) {
399
+							var field='',sort=self['sort'+idx];
400
+							if(sort ) {
401
+								sort=sort=='asc'?'desc':'asc';
402
+							} else {
403
+								// 등록일 내림차순, 제목 오름차순
404
+								sort=idx==4? 'desc':idx==5? 'asc': 'desc';
405
+							}
406
+							const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top'; 
407
+							self['sort'+idx]=sort;
408
+							if(idx==4) {
409
+								field='storeNm';
410
+							} else if(idx==5) {
411
+								field='loanMgntUnqNo';
412
+							} 
413
+							param.page=1;
414
+							param.sidx=field;
415
+							param.sord=sort;
416
+							
417
+							$(LOANMNG01010_GRID_ID).jqGrid('setGridParam',{
418
+								postData:JSON.stringify(param)
419
+							}).trigger('reloadGrid');
420
+							$(this).find('.s-ico').show();
421
+							$(this).find('.ui-grid-ico-sort').hide();
422
+							$(this).find(icon).show();
423
+
424
+						}
425
+					});
389 426
 				},
390 427
 				onPaging: function(action) {
391 428
 					itp_fn_grid_paging(LOANMNG01010_GRID_ID, action, param);

+ 37 - 2
src/main/webapp/js/app/loanmng/ITP_LOANMNG02010.js

@@ -558,8 +558,43 @@ let listObj = {
558 558
 						$(LOANMNG02010_GRID_ID).jqGrid('setCell', rowId, 'dpstDt', '', ITP_GRID_COL_STYLE.link);
559 559
 					});
560 560
 					
561
-					
562
-					
561
+					const self=this;
562
+					if(self.sortUse) return;
563
+					self.sortUse=true;
564
+					$(LOANMNG02010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').css('cursor','default');
565
+					$(LOANMNG02010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(6).css('cursor','pointer');
566
+					$(LOANMNG02010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(8).css('cursor','pointer');
567
+					$(LOANMNG02010_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
568
+						const idx=$(this).index();
569
+						console.log("xxxx grid header click xxxxxxx index=="+idx, param );
570
+						if(idx==6 || idx==8) {
571
+							var field='',sort=self['sort'+idx];
572
+							if(sort ) {
573
+								sort=sort=='asc'?'desc':'asc';
574
+							} else {
575
+								// 등록일 내림차순, 제목 오름차순
576
+								sort=idx==6? 'desc':idx==8? 'asc': 'desc';
577
+							}
578
+							const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top'; 
579
+							self['sort'+idx]=sort;
580
+							if(idx==6) {
581
+								field='storeNm';
582
+							} else if(idx==8) {
583
+								field='loanMgntUnqNo';
584
+							} 
585
+							param.page=1;
586
+							param.sidx=field;
587
+							param.sord=sort;
588
+							
589
+							$(LOANMNG02010_GRID_ID).jqGrid('setGridParam',{
590
+								postData:JSON.stringify(param)
591
+							}).trigger('reloadGrid');
592
+							$(this).find('.s-ico').show();
593
+							$(this).find('.ui-grid-ico-sort').hide();
594
+							$(this).find(icon).show();
595
+
596
+						}
597
+					});
563 598
 				},
564 599
 				onPaging: function(action) {
565 600
 					itp_fn_grid_paging(LOANMNG02010_GRID_ID, action, param);

+ 76 - 0
src/main/webapp/js/app/loanmng/ITP_LOANMNG03010.js

@@ -465,6 +465,46 @@ let listObj = {
465 465
 					$.each(ids, function(idx, rowId) {
466 466
 						$(LOANMNG03010_GRID_ID).jqGrid('setCell', rowId, 'sttlMgntUnqNo', '', ITP_GRID_COL_STYLE.link);
467 467
 					});
468
+					const self=this;
469
+					if(self.sortUse) return;
470
+					self.sortUse=true;
471
+					$(LOANMNG03010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').css('cursor','default');
472
+					$(LOANMNG03010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(4).css('cursor','pointer');
473
+					$(LOANMNG03010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(5).css('cursor','pointer');
474
+					$(LOANMNG03010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(6).css('cursor','pointer');
475
+					$(LOANMNG03010_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
476
+						const idx=$(this).index();
477
+						console.log("xxxx grid header click xxxxxxx index=="+idx, param );
478
+						if(idx==4 || idx==5 || idx==6) {
479
+							var field='',sort=self['sort'+idx];
480
+							if(sort ) {
481
+								sort=sort=='asc'?'desc':'asc';
482
+							} else {
483
+								// 등록일 내림차순, 제목 오름차순
484
+								sort=idx==4? 'desc':idx==5? 'asc': 'desc';
485
+							}
486
+							const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top'; 
487
+							self['sort'+idx]=sort;
488
+							if(idx==4) {
489
+								field='storeNm';
490
+							} else if(idx==5) {
491
+								field='loanDvsnNm';
492
+							} else if(idx==6) {
493
+								field='sttlMgntUnqNo';
494
+							} 
495
+							param.page=1;
496
+							param.sidx=field;
497
+							param.sord=sort;
498
+							
499
+							$(LOANMNG03010_GRID_ID).jqGrid('setGridParam',{
500
+								postData:JSON.stringify(param)
501
+							}).trigger('reloadGrid');
502
+							$(this).find('.s-ico').show();
503
+							$(this).find('.ui-grid-ico-sort').hide();
504
+							$(this).find(icon).show();
505
+
506
+						}
507
+					});
468 508
 				},
469 509
 				onPaging: function(action) {
470 510
 					itp_fn_grid_paging(LOANMNG03010_GRID_ID, action, param);
@@ -610,6 +650,42 @@ let viewObj = {
610 650
 				pager: LOANMNG03010_VIEW_GRID_PAGER,
611 651
 				loadComplete: function(data) {
612 652
 					itp_fn_grid_load_complete(data, LOANMNG03010_VIEW_GRID_ID, true, undefined, 'LOANMNG03010_VIEW');
653
+					const self=this;
654
+					if(self.sortUse) return;
655
+					self.sortUse=true;
656
+					$(LOANMNG03010_VIEW_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').css('cursor','default');
657
+					$(LOANMNG03010_VIEW_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(6).css('cursor','pointer');
658
+					$(LOANMNG03010_VIEW_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
659
+						const idx=$(this).index();
660
+						console.log("xxxx grid header click xxxxxxx index=="+idx, param );
661
+						if(idx==6 || idx==5) {
662
+							var field='',sort=self['sort'+idx];
663
+							if(sort ) {
664
+								sort=sort=='asc'?'desc':'asc';
665
+							} else {
666
+								// 등록일 내림차순, 제목 오름차순
667
+								sort=idx==6? 'desc':idx==5? 'asc': 'desc';
668
+							}
669
+							const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top'; 
670
+							self['sort'+idx]=sort;
671
+							if(idx==6) {
672
+								field='itemNm';
673
+							} else if(idx==5) {
674
+								field='loanMgntUnqNo';
675
+							} 
676
+							param.page=1;
677
+							param.sidx=field;
678
+							param.sord=sort;
679
+							
680
+							$(LOANMNG03010_VIEW_GRID_ID).jqGrid('setGridParam',{
681
+								postData:JSON.stringify(param)
682
+							}).trigger('reloadGrid');
683
+							$(this).find('.s-ico').show();
684
+							$(this).find('.ui-grid-ico-sort').hide();
685
+							$(this).find(icon).show();
686
+
687
+						}
688
+					});	
613 689
 				},
614 690
 				onPaging: function(action) {
615 691
 					var pagingFn = {