|
@@ -408,46 +408,59 @@ let listObj = {
|
408
|
408
|
}, 100);
|
409
|
409
|
},
|
410
|
410
|
loadComplete: function(data) {
|
|
411
|
+ let param = $('#ITP_FORM_STOCKMNG03010_SEARCH').serializeObject();
|
411
|
412
|
const self=this;
|
412
|
413
|
if(self.sortUse) return;
|
413
|
414
|
self.sortUse=true;
|
414
|
|
- self['sort3']='asc';
|
415
|
|
- const th=$(STOCKMNG03010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(3);
|
|
415
|
+ self['sort9']='asc';
|
|
416
|
+ const th=$(STOCKMNG03010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(9);
|
416
|
417
|
th.find('.s-ico').show();
|
417
|
418
|
th.find('.ui-grid-ico-sort').hide();
|
418
|
419
|
th.find('.glyphicon-triangle-bottom').show();//asc 는 bottom 으로
|
419
|
|
- //$(RTNMNG05010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').css('cursor','default');
|
420
|
|
- $(STOCKMNG03010_GRID_LIST).find('th').eq(3).css({cursor:'pointer',background:'#FFEBCD'});
|
|
420
|
+ $(STOCKMNG03010_GRID_LIST).find('th').css('cursor','default');
|
421
|
421
|
$(STOCKMNG03010_GRID_LIST).find('th').eq(9).css({cursor:'pointer',background:'#FFEBCD'});
|
422
|
422
|
$(STOCKMNG03010_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
|
423
|
423
|
const idx=$(this).index();
|
424
|
424
|
console.log("xxxx grid header click xxxxxxx index=="+idx, param );
|
425
|
|
- if(idx==3 || idx==9) {
|
|
425
|
+ if( idx==9) {
|
426
|
426
|
var field='',sort=self['sort'+idx];
|
427
|
427
|
if(sort ) {
|
428
|
428
|
sort=sort=='asc'?'desc':'asc';
|
429
|
|
- } else {
|
430
|
|
- // 등록일 내림차순, 제목 오름차순
|
431
|
|
- sort=idx==3? 'asc':idx==9? 'desc': 'asc';
|
432
|
|
- }
|
|
429
|
+ }
|
433
|
430
|
const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top';
|
434
|
431
|
self['sort'+idx]=sort;
|
435
|
|
- if(idx==3) {
|
436
|
|
- field='location';
|
437
|
|
- } else if(idx==9) {
|
438
|
|
- field='itemNm';
|
439
|
|
- }
|
|
432
|
+ field='itemNm';
|
440
|
433
|
param.page=1;
|
441
|
434
|
param.sidx=field;
|
442
|
435
|
param.sord=sort;
|
443
|
|
-
|
444
|
|
- $(STOCKMNG03010_GRID_ID).jqGrid('setGridParam',{
|
445
|
|
- postData:JSON.stringify(param)
|
446
|
|
- }).trigger('reloadGrid');
|
|
436
|
+ param.pagingYn=false;
|
447
|
437
|
$(this).find('.s-ico').show();
|
448
|
438
|
$(this).find('.ui-grid-ico-sort').hide();
|
449
|
439
|
$(this).find(icon).show();
|
450
|
|
-
|
|
440
|
+ listObj.grid.clearData();
|
|
441
|
+ ajaxCall(STOCK_BASE_MNG_DETAIL_GRID_LIST, param, result=>{
|
|
442
|
+ const data=result.gridRows;
|
|
443
|
+ const rowCnt=data.length;
|
|
444
|
+ const container=$('#ITP_STOCKMNG03010_jqGrid_list').closest('#ITP_CONTAINER');
|
|
445
|
+ let hei=container.height();
|
|
446
|
+ if(hei>300 ) {
|
|
447
|
+ hei-=255;
|
|
448
|
+ } else {
|
|
449
|
+ hei=300;
|
|
450
|
+ }
|
|
451
|
+ $('#ITP_STOCKMNG03010_jqGrid_list .ui-jqgrid-bdiv').height(hei);
|
|
452
|
+ var idx=1;
|
|
453
|
+ for(var cur of data ) {
|
|
454
|
+ $(STOCKMNG03010_GRID_ID).addRowData(idx++, cur);
|
|
455
|
+ }
|
|
456
|
+ let viewHtml = '';
|
|
457
|
+ viewHtml += '<span class="itp_shrv fix">';
|
|
458
|
+ viewHtml += '<span class="shrv_txt">' + ITP_MSG_LOCALE.label.total + '</span>';
|
|
459
|
+ viewHtml += '<span class="shrv_num shrv_tot">(<em>' + rowCnt + '</em>)</span>';
|
|
460
|
+ viewHtml += '</span>';
|
|
461
|
+ $('#ITP_STOCKMNG03010_jqGridView').html(viewHtml).show();
|
|
462
|
+ $(STOCKMNG03010_GRID_EMPTY).hide();
|
|
463
|
+ }, 'POST');
|
451
|
464
|
}
|
452
|
465
|
});
|
453
|
466
|
},
|