jsonforms icon indicating copy to clipboard operation
jsonforms copied to clipboard

Add "showSortingButtons" support for Angular Material renderers

Open osmanraifgunes opened this issue 2 years ago • 1 comments

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

image

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.

osmanraifgunes avatar Mar 17 '22 08:03 osmanraifgunes

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.

sdirix avatar Mar 25 '22 10:03 sdirix

I know it might be a bit late for OP but here's a pending PR: https://github.com/eclipsesource/jsonforms/pull/2038

fredjohnd avatar Oct 25 '22 15:10 fredjohnd

Closed via #2038

lucas-koehler avatar Nov 07 '22 14:11 lucas-koehler