Table
props
다음과 같은 필수 props를 받는다.
columns: [Object]
columns는 이 table의 column을 정의한다.
object의 array이고 object는 다음과 같은 형식을 가진다.
{
# column name이다. rows의 참조할 key name이기도 하다.
name: String
# type은 filter 양식이나 format을 결정한다.
type: one of ['string', 'number', 'date', 'bool', 'button', 'price']
# mobile에서 보여질 때 하나의 field만 보여지는데 그 field를 결정.
isMain: Bool
# column label
title: String
# default column width. px단위이다.
width: Number
}
rows: [Object]
rows는 테이블에 채워질 data를 뜻한다.
getRowBackroundColor: Func(row): String(color) (optional)
row에 따라서 색상을 return하는 function
orderedColumnNames: [String] (optional)
초기 colums의 순서를 결정한다.
column name의 array를 넘겨준다.
onChangeOrderedColumnNames: Func[String]
column의 순서가 바뀔때마다 호출된다.
column 순서의 String 배열이 매개변수로 넘어온다.
onChangeColumnWidths: Func([Object])
column width가 변할 때마다 호출된다.
다음 형태의 Object의 array가 매개변수로 넘어온다.
{
columnName: String,
width: Number
}
onChangeSelection: Func([Object])
selection이 변할 때마다 호출된다.
선택된 row 객체의 array를 매개변수로 전달해준다.