Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can I set a color picker for my extension in Qlik Sense?

Can I set a color picker for my extension in Qlik Sense? I know that in Qlikview I can add a Color property in the Definition.xml file, but how can I do it in Qlik Sense?

Thanks in advance

1 Solution

Accepted Solutions
Not applicable
Author

Yes you can. Try add this snippet to your definition.

color: {

                    ref: "color",

                    translation: "properties.color",

                    type: "integer",

                    component: "color-picker",

                    defaultValue: 2

                },

Cheers

Karl

View solution in original post

10 Replies
Aiham_Azmeh
Employee
Employee

Hi Alejandro,

Unfortunately, at this moment you can't have a color picker in the properties panel like in QlikView.

Here is a list with custom properties that you can add to your extension:

http://help.qlik.com/sense/en-us/developer/#../Subsystems/Workbench/Content/BuildingExtensions/HowTo...

Custom property type definitions

The following property type definitions can be used:

  • String definitions
  • Integer definitions
  • Number definitions
  • Check box definitions
  • Drop down definitions
  • Radio button definitions
  • Switch definitions
  • Slider definitions
  • Range slider definitions
Not applicable
Author

Yes you can. Try add this snippet to your definition.

color: {

                    ref: "color",

                    translation: "properties.color",

                    type: "integer",

                    component: "color-picker",

                    defaultValue: 2

                },

Cheers

Karl

Aiham_Azmeh
Employee
Employee

Hi Karl,

You're right, but the color-picker is for now "internal" and not "yet" an exposed component, so personally I do not recommend using it for deployment since, it may change.

The supported components are listed in the help site here: http://help.qlik.com/sense/en-us/developer/#../Subsystems/Workbench/Content/BuildingExtensions/HowTo...

componentUsed for defining how the property is visualized in the property panel. Used to override the default component that comes with the type setting. Can be either dropdown, radiobuttons, switch or slider.
rbartley
Specialist II
Specialist II

Hi Karl,

I'm new to extensions and the documentation isn't particularly easy to understand.  When I add the color-picker component, I can see it in the menu, but when I change the colour it doesn't have any effect on my custom table extension.  I assume I need to reference this somewhere else in the js file.  I'd appreciate your help.

Cheers,

Richard

Not applicable
Author

The color picker returns a number between 0 to 11 for the colors. The index refers to the palette in the general service media tools theme.

You need to make these changes to add the media-tool theme

define(["jquery", "text!./simpletable2.css", "general.services/media-tool/theme"], function($, cssContent, mediaTool) {

    'use strict';

and you need the layout argument in the paint function

paint: function($element, layout) {

     console.log(mediaTool.palette[layout.color]);

Hope this helps

Karl

Alexander_Thor
Employee
Employee

Ha, you sneaky reverse engineer you


Anyways, I love to see that you re-use our internal components just keep in mind that these might/will change over time.

ewg is probably very interested in hearing more about which components that you re-use which is not covered as part of the API. Then perhaps we can make them part of it, the API, and vis-à-vis also supported.

rbartley
Specialist II
Specialist II

Thanks Karl,

It's a shame that there doesn't seem to be any accessible and detailed documentation.  The online help is all too basic.

Regards,

Richard

Not applicable
Author

I would like to see alot of those services and components that's built in covered in the API when they are more mature/stable. Why invent the wheel again for all common tasks. I also would like to see the components and services adapted to a more generic use. The number-formatter, for example, it's hard coded for qNumFormat and doesn't work with qNumberPresentations. And another example, the items component doesn't support reordering like the dimensions do.

If you could dream I imagine the built in components like axis, lines etc to be available as a toolbox for all. That would really remove the separation between things built by Qlik and visualizations produced by a partner or a customer. The way forward is a common design language, like Apple did with iOS.

When Qlik Sense becomes more mature and the documentation is fleshed out I know it will be better and more components will be available. But in the meantime it's easier to reverse engineer if you want to play around.

Not applicable
Author

Picking this up and hopefully can grab a hint: Can i add a color picker to a dimension property ?

I tried something like this, but no success (obviously):

dim.PNG

Any help is much appreciated.

Thanks!