formatter
-
Attribute:
data-formatter
-
Type:
Function
-
Detail:
The context (this) is the column Object.
The cell formatter function, take three parameters:
value
: the field value.row
: the row record data.index
: the row index.field
: the row field.
-
Default:
undefined
-
Example: Column Formatter
formatter这个属性属于列参数,意思就是对当前列的数据进行格式化操作,它是一个函数,有三个参数,value,row,index,
value: 代表当前单元格中的值,
row: 代表当前行,
index:代表当前行的下标,
可以使用return 返回你想要的数据显示在单元格中;