|
@@ -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 = {
|