FilterCategory
Category classification model when creating custom automatic filtering
Signature:
export interface FilterCategory
Remarks
Category Callback This is the type of model that must be returned from .
It is used when actually setting category callbacks of FilterAutomatingOptions.
Example
// In case of Date
[
{
text: "2019",
children: [
{
text: "2nd quarter",
children: [
{
text: "June",
children: [
{text: "2019-06-11", year: 2019, month: 5, day: 11},
{text: "2019-06-12", year: 2019, month: 5, day: 12},
{text: "2019-06-18", year: 2019, month: 5, day: 18},
{text: "2019-06-27", year: 2019, month: 5, day: 27},
{text: "2019-06-30", year: 2019, month: 5, day: 30}
],
year: 2019,
quarter: 1,
month: 5
}
],
year: 2019,
quarter: 1
},
{
text: "3rd quarter",
children: [
{
text: "July",
children: [
{text: "2019-07-03", year: 2019, month: 6, day: 3},
{text: "2019-07-07", year: 2019, month: 6, day: 7},
{text: "2019-07-17", year: 2019, month: 6, day: 17},
{text: "2019-07-21", year: 2019, month: 6, day: 21}
],
year: 2019,
quarter: 1,
month: 6
},
{
text: "August",
...
}
],
year: 2019,
quarter: 2
},
{
text: "4th quarter",
children: [
{
text: "October",
children: [
...
],
year: 2019,
quarter: 3,
month: 9
}
],
year: 2019,
quarter: 3
},
],
year: 2019,
},
{
text: '2020',
...
}
]
[
{text: "2019-06-11", year: 2019, month: 5, day: 11}
{text: "2019-06-12", year: 2019, month: 5, day: 12}
{text: "2019-06-18", year: 2019, month: 5, day: 18},
...
{text: "2021-12-27", year: 2021, month: 12, day: 27}
]
// In case of text
[
{text: "A ~ C", values: [
“Adrian”, “Adrienne”, “Aladdin”, “Alden”, “Alea”, “Alexa”, “Amber”,
“Amy”, “Arsenio”, “Beatrice”, “Benedict”, “Benjamin”, “Blaze”, “Brennan”,
]},
{text: "D ~ F", values: [...]},
{text: "G ~ I", values: [...]},
{text: "J ~ L", values: [...]}
]
[
{text: "Adrian", value: "Adrian"},
{text: "Adrienne", value: "Adrienne"},
{text: "Aladdin", value: "Aladdin"},
{text: "Alden", value: "Alden"},
{text: "Alea", value: "Alea"}
]
// In case of Number
[
{text: "0 ~ 25", values: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]},
{text: "25 ~ 50", values: [...]},
{text: "50 ~ 75", values: [...]},
{text: "75 ~ 100", values: [...]}
]
[
{text: "0 ~ 1", values: [0]},
{text: "1 ~ 2", values: [1]},
{text: "2 ~ 3", values: [2]},
{text: "3 ~ 4", values: [3]},
{text: "4 ~ 5", values: [4]},
{text: "5 ~ 6", values: [5]},
{text: "6 ~ 7", values: [6]},
...
{text: "99 ~ 100", values: [99]}
]
Events
Property | Type | Description |
---|---|---|
callback | FilterCallback | Callback to determine filter |
Properties
Property | Type | Description |
---|---|---|
childrens | FilterCategory[] | Items in subgroups |
criteria | string | expression |
day | number | job information |
empty | boolean | Whether or not the item has an empty value |
month | number | Month information |
quarter | number | Branch Information |
tag | any | Tags |
text | string | Text displayed on items in the filter selection box |
value | any | value |
values | any[] | values |
year | number | Year information |
Event Desc
callback
Callback to determine filter
Type
- FilterCallback
Remarks:
true
: When subject to filtering, false
: When subject to exclusion from filtering
Properties Desc
children
Items in subgroups
Type
- FilterCategory[]
criteria
expression
Type
- string
Remarks:
If omitted, a grid is created using the entered information.
day
work information
Type
- number
Remarks:
Used when setting FilterAutomatingOptions.dateCategoryCallback.
empty
Whether the item is empty or not
Type
- boolean
month
month information
Type
- number
Remarks:
Used when setting FilterAutomatingOptions.dateCategoryCallback.
0
to 11
means January, February, ..., and December, respectively.
quarter
branch information
Type
- number
Remarks:
Used when setting FilterAutomatingOptions.dateCategoryCallback.
0
to 3
represent the 1st, 2nd, 3rd, and 4th quarters, respectively.
tag
tag
Type
- any
text
Text displayed on items in the filter selection box
Type
- string
value
value
Type
- any
Remarks:
Used when setting FilterAutomatingOptions.textCategoryCallback.
values
values
Type
- any[]
Remarks:
Used when setting FilterAutomatingOptions.textCategoryCallback, or FilterAutomatingOptions.numberCategoryCallback.
year
Year information
Type
- number
Remarks:
Used when setting FilterAutomatingOptions.dateCategoryCallback.