Badge
The Badge cell displays one of the following badge.
OK
OK
42
+999
KO
Badge Status
OK
Menu
One of the main purpose of this typeCell is to display a menu based on the current value.
SwitchBagde
The SwitchBadge cell allows to handle advanced needs, like 3 dimensionnals datas.
Example
In this example, we will display the grades of students during the year and for multiple subject.
History
Winter
Spring
Summer
<CodePreview
content={SwitchBadgeGradeExampleSource}
/>
tip
This could be achieve without using SwithBadge
by using a dynamic data object. But the advantage of SwitchBadge
is to only update the config props. This can be very useful with a large amount of data.
Props
Name | Type | Required | Default | Description |
---|---|---|---|---|
actionsByStatus | array | No | [] | Array of actionByStatus passed to ContextMenu component |
switchKey | string | Yes | Warning: Only working with switch_badge_status typeCell. |
actionByStatus
Name | Type | Required | Default | Description |
---|---|---|---|---|
action | func | Yes | Callback fired when the choice is selected | |
label | any | Yes | Element passed as a children to MenuItem | |
status | array | Yes | Array of status that allows this choice |