본문 바로가기

웹 개발/extjs4

extjs grid 헤더와 컬럼 따로 정렬하기

기본적으로 extjs4에서는 헤더와 컬럼은 동일하게 정렬된다.
이를 개별로 지정하는 속성은 따로 없고, 스타일로 지정을 해 주어야 한다.

자세한 것은 바로 코드로 확인할 수 있다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 그리드 생성
grid = Ext.create('Ext.grid.Panel',
{   store : store,
    stateful : true,
    collapsible : true,
    stateId : 'stateGrid',  columns : [
        /*
        * 헤더와 컬럼의 정렬이 동일할 경우 align 만 사용
        * 헤더 정렬  ->  style: 'text-align:center'
        * 컬럼 정렬  ->   align:' { left || center || right }'
        */
          { text : '직원명',   width : 150,    sortable : false,   dataIndex : 'NAME', style: 'text-align:center',     align:'left'}  
          , { text : '소속사무소',   width : 150,    sortable : false,   dataIndex : 'BRNM', style: 'text-align:center',     align:'left'}  
        ],
        autoHeight:true,
        width : 1025,
        title : '사용자 목록',
        renderTo : 'grid',
        viewConfig : {
            stripeRows : true,
            enableTextSelection : false
        }









'웹 개발 > extjs4' 카테고리의 다른 글