Class (cell)

셀에 적용할 사용자 정의 CSS를 설정합니다.

Type

string

Options

Value Description
string CSS에 정의한 클래스 이름

주의 사항

Example

<style>
/* 글자를 빨간색, 볼드로 표시 */
.RedBold{color:#FF0000; font-weight:700;}
</style>
//1. 데이터 행객체(예: AR10)에 직접 접근하여 셀에 CSS 적용
var ROW = sheet.getRowById("AR10");
ROW["CLSClass"] = "RedBold";
//변경내용 반영
sheet.refreshCell({row:ROW, col:"CLS"});

//2. 함수를 이용하여 셀에 CSS 적용
var row = sheet.getRowById("AR1");
sheet.setAttribute({ "row" :row ,"col":"CLS", "attr":"Class", "val":"RedBold" });

//3. 조회 데이터 내에서 속성설정(열이름이 CLS 로 가정)
{
    data:[
        {... , "CLSClass":"RedBold" , ...}
    ]
}

// ClassFormula — 조건에 따라 셀 클래스를 자동 지정 (CanFormula, CalcOrder 필요)
options = {
    Def: {
        Row: {CanFormula: 1, CalcOrder: "CLSClass"}  // "열이름 + Class" 형식
    },
    Cols: [
        {Type: "Text", Name: "CLS",
            ClassFormula: function(fr) {
                // CLS 셀 값이 "긴급"이면 RedBold 클래스 적용
                if (fr.Row["CLS"] === "긴급") return "RedBold";
            }
        }
    ]
};

Try it

Read More

Since

product version desc
core 8.0.0.0 기능 추가