Possible column types
- Supported column types : string, number, date, combo.
- This grid allows columns with null values.
- For user convenience, column types will continue to be added.
How to use string columns
- Set the column type property to string. (ex) type : "string"
- If the type is not declared, the default type value is "string".
let columns = [
{ name : "userName" , header: { text:"Code" }, width: 100 , type: "string" }
, { name : "email" , header: { text:"Manager"}, width: 100 } // type is string
}
How to use number columns
- Set the column type property to number. (ex) type : "number"
- Number type has several options.
let columns = [
{ name : "amt" , theader: { text:"Code" }, width: 100 , type: "number" }
}
How to use number columns (scale property)
- The scale property is similar to column types in a database.
- scale : "18, 2" (ex) 100.2345 -> 100.23
- scale : "18" (ex) 100.2345 -> 100
let columns = [
{ name : "amt" , header: { text:"Code" }, width: 100 , type: "number", scale: "18, 2" }
,{ name : "amt1" , header: { text:"Code" }, width: 100 , type: "number", scale: "18, 1" }
,{ name : "amt1" , header: { text:"Code" }, width: 100 , type: "number", scale: "18, 4" }
}
How to use number columns (roundType property)
- If the roundType is not declared, the default value is "round".
- The roundType property has round, ceil, floor.
- The roundType property is used in conjunction with the scale property.
- scale : "18, 2", roundType : "round" (ex) 100.245 -> 100.25
- scale : "18, 2", roundType : "ceil" (ex) 100.241 -> 100.25
- scale : "18, 2", roundType : "floor" (ex) 100.247 -> 100.24
let columns = [
{ name : "amt" , header: { text:"Code" }, width: 100 , type: "number", scale: "18, 2", roundType: "round" }
,{ name : "amt1" , header: { text:"Code" }, width: 100 , type: "number", scale: "18, 1", roundType: "ceil" }
,{ name : "amt1" , header: { text:"Code" }, width: 100 , type: "number", scale: "18, 4", roundType: "floor" }
}
How to use number columns (fixedScale property)
- The fixedScale is a fixed number of decimal places. (The default value is true)
- fixedScale : true (ex) 100.000 -> 100.000
- fixedScale : false (ex) 100.241 -> 100
let columns = [
{ name : "amt" , header: { text:"Code" }, width: 100 , type: "number", scale: "18, 2", roundType: "round", fixedScale: true }
,{ name : "amt1" , header: { text:"Code" }, width: 100 , type: "number", scale: "18, 1", roundType: "ceo" , fixedScale: false }
}
How to use date columns
- Dates only support 8 digits.
- Only special characters '.', '/', '-' are allowed.
let columns = [
{ name : "date1" , header: { text:"Code" }, width: 100 , type : 'date', format : 'dd.MM.yyyy' }
, { name : "date1" , header: { text:"Code" }, width: 100 , type : 'date', format : 'dd-MM-yyyy' }
, { name : "date1" , header: { text:"Code" }, width: 100 , type : 'date', format : 'dd/MM/yyyy' }
, { name : "date1" , header: { text:"Code" }, width: 100 , type : 'date', format : 'ddMMyyyy' }
}
How to use combo columns
- The user must create combo data.
- The data format is as follows.
- let data = {key: 'code_key', val : 'code_value', data : [{code_key: '01', code_value: '12'}, {code_key: '02', code_value: '24'},....]}
- key : User specified code field name.
- val : User specified value filed name.
- data : Array
let data = {key: 'code_key', val : 'code_value', data : [{code_key: '01', code_value: '12'}, {code_key: '02', code_value: '24'},....]}
let columns = [
{ name : 'ckcd', header: { text:'C/K' }, width : 100, visible : true , editable : true , type : 'combo', combo : data }
}