Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rollo 4 posts 94 karma points
    Nov 18, 2019 @ 15:45
    Rollo
    0

    Color picker in grid style settings

    Is there any way to use the Approved Color data type in the grid style? I assume you should be able to use it the same way that you use the Media Picker?

    Something like this:

    [
      {
        "label": "Background color",
        "description": "Choose a background color",
        "key": "background-color",
        "view": "colorpicker",
        "applyTo": "cell",
        "prevalues": [
          "#119D65",
          "#53B3AE"
        ]
      }
    ]
    

    It doesnt return an error, the editor still doesn't appear in my grid settings however. Am I missing something?

  • Amir Khan 1282 posts 2739 karma points
    Nov 18, 2019 @ 19:11
    Amir Khan
    0

    This package helps a lot: https://github.com/jamiepollock/Umbraco-Grid-Settings

    Then you can do this in the grid config

    [
      {
        "label": "Set background color",
        "description": "Set the row background color",
        "key": "class4",
        "view": "/App_Plugins/Our.Umbraco.GridSettings/editors/ColorPicker/view.html",
        "prevalues": [
          {
            "label": "color-primary",
            "value": "23265A"
          },
          {
            "label": "color-tertiary",
            "value": "034EA2"
          }
        ],
        "modifier": "background-color-{0}"
      }
    ]
    
  • Rollo 4 posts 94 karma points
    Nov 19, 2019 @ 09:49
    Rollo
    0

    Thanks Amir, but that package downgraded my entire web project to v 7.5.4. I'm on 8.3.0 currently and everything became no bueno.

  • Rollo 4 posts 94 karma points
    Nov 19, 2019 @ 12:22
    Rollo
    100

    An update:

    It was an overlook on my part. My code states:

    "applyTo": "cell",
    

    and I tried to apply it to a column...

  • Amir Khan 1282 posts 2739 karma points
    Nov 19, 2019 @ 14:32
    Amir Khan
    0

    Ah. So you're good to go then?

  • Rollo 4 posts 94 karma points
    Nov 19, 2019 @ 15:13
    Rollo
    0

    Yep!

Please Sign in or register to post replies

Write your reply to:

Draft