jsonforms
jsonforms copied to clipboard
Add "showSortingButtons" support for Angular Material renderers
Describe the bug
Sort buttons are not appearing for array data
Expected behavior
I want array to be sortable by arraows.
Steps to reproduce the issue
Scehma :
{
"type": "object",
"properties": {
"steps": {
"type": "array",
"items": {
"type": "object",
"properties": {
"action": {
"type": "object",
"properties": {
"action_json": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
Ui schema :
{
"type": "ListWithDetail",
"scope": "#/properties/steps",
"options": {
"labelRef": "#/properties/action/properties/action_name",
"detail": {
"type": "Control",
"scope": "#/properties/action/properties/action_json",
"options": {
"showSortingButtons": true,
"detail": {
"type": "HorizontalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/name"
}
]
}
}
}
}
}
Screenshots
In which browser are you experiencing the issue?
Chrome
Framework
Angular
RendererSet
Material
Additional context
I even tried demo data on documentation : https://jsonforms.io/docs/uischema/controls/#sorting-buttons-showsortbuttons But it also did not show sort buttons.
Hi @osmanraifgunes,
None of our Angular renderers support showSortingButtons
(yet). If you'd like you can contribute this feature for one or more of the renderers. In your case it's the master-detail
renderer which handles ListWithDetail
.
Instead of a contribution you could also implement a custom renderer which has support for showSortingButtons
and use that one instead.
I know it might be a bit late for OP but here's a pending PR: https://github.com/eclipsesource/jsonforms/pull/2038
Closed via #2038