var projectData = [
{ task: '로그인 모듈', assignee: '김지수', progress: 100, status: 'done' },
{ task: 'API 연동', assignee: '이준호', progress: 65, status: 'active' },
{ task: 'UI 디자인', assignee: '박미래', progress: 30, status: 'pending' },
{ task: '데이터베이스 설계', assignee: '최현우', progress: 100, status: 'done' },
{ task: '테스트 자동화', assignee: '정수아', progress: 0, status: 'pending' },
{ task: '배포 파이프라인', assignee: '윤서진', progress: 80, status: 'active' },
{ task: '문서화', assignee: '임채원', progress: 45, status: 'active' },
{ task: '코드 리뷰', assignee: '강민준', progress: 100, status: 'done' }
];
var flex = new wijmo.grid.FlexGrid('#statusGrid', {
isReadOnly: true,
itemsSource: new wijmo.collections.CollectionView(projectData),
columns: [
{ binding: 'task', header: '작업', width: 160 },
{ binding: 'assignee', header: '담당자', width: 90 },
{ binding: 'progress', header: '진행률', width: 130 },
{ binding: 'status', header: '상태', width: 100 }
]
});
var STATUS_MAP = {
done: { color: '#28a745', label: '완료' },
active: { color: '#007bff', label: '진행중' },
pending: { color: '#6c757d', label: '대기' }
};
flex.itemFormatter = function(panel, r, c, cell) {
if (panel.cellType !== wijmo.grid.CellType.Cell) return;
cell.style.backgroundColor = '';
cell.innerHTML = panel.getCellData(r, c, true);
var col = panel.columns[c];
var item = panel.rows[r].dataItem;
if (col.binding === 'status') {
var s = STATUS_MAP[item.status] || STATUS_MAP.pending;
cell.innerHTML =
'<div style="display:inline-flex;align-items:center;' +
'background-color:' + s.color + ';color:#fff;' +
'padding:2px 10px;border-radius:12px;font-size:11px;font-weight:bold;">' +
s.label + '</div>';
} else if (col.binding === 'progress') {
var pct = item.progress;
var barColor = pct === 100 ? '#28a745' : pct >= 50 ? '#007bff' : '#ffc107';
cell.innerHTML =
'<div style="display:flex;align-items:center;gap:6px;">' +
'<div style="flex:1;background-color:#e9ecef;border-radius:4px;height:10px;">' +
'<div style="width:' + pct + '%;background-color:' + barColor + ';' +
'height:10px;border-radius:4px;"></div></div>' +
'<span style="font-size:11px;color:#495057;min-width:28px;">' + pct + '%</span>' +
'</div>';
}
};