SMART datagrid v1.4 > Classes > GridBase

Back  Forward

DataLudi.GridBase.setCellStyle  method

매개변수 dataRowIndexfield로 지정되는 데이터셀을, 그리드에 styleId로 등록되어 있는 CellStyle로 적용시킨다. 

updateNowtrue면 지금 즉시 셀을 다시 그리고, 편집기가 표시돼 있던 상태라면 편집기의 상태도 재설정한다. 

field에 0보다 작은 값을 지정하면 행의 모든 셀에 적용된다. 또, dataRowIndex에 0보다 작은 값을 지정하면 추가되는 행에 적용된다. 

function setCellStyle (dataRowIndex: Integer, field: Integer|String, styleId: String, updateNow: Boolean);
Returns
Void
Parameters
dataRowIndex - Integer. required.
그리드행에 연결된 데이터행 번호. GridRow.dataIndex
field - Integer|String. required.
데이터필드 인덱스나 필드명.
styleId - String. required.
그리드에 등록된 CellStyle 아이디.
updateNow - Boolean. 기본값은 false.
true면 스타일 적용후 바로 다시 그린다.
Code -1
    grid.registerCellStyles([{
        id: 'style01', 
        "background": "#880000",
        "color": "#ffffff"
    }, {
        id: 'style02', 
        background: "#000088",
        color: "#ffffff"
    }];
    grid.setCellStyle(0, 'country', 'style01', true);
note
See Also
GridBase.registerCellStyles
setCellStyles
CellStyle
Examples
Cell Styles