开发者

In CQ5, how do I configure an extJS component?

开发者 https://www.devze.com 2023-03-11 01:24 出处:网络
This question is specific to Adobe CQ5, so ExtJS answers by themselves won\'t be that helpful. I have a custom text component with a menu option to change the background color. We\'re referencing a c

This question is specific to Adobe CQ5, so ExtJS answers by themselves won't be that helpful.

I have a custom text component with a menu option to change the background color. We're referencing a colorfield component in our dialog.xml, and so far everything works. The color menu appears with the default set of colors in the palette and can be clicked. So far so good.开发者_如何学JAVA

I would now like to customize the palette and only show a select set of colors specific to our client. How do I achieve this?

Here's the relevant dialog.xml snippet so far:

<bgcolor
jcr:primaryType="cq:Widget"
fieldLabel="Background color"
name="./bgColor"
showHexValue="true"
xtype="colorfield"/>


For future reference, you could probably get by creating a custom ColorField to call a custom ColorMenu which sets a custom ColorPalette. If ColorField had configurable options, these would probably be mentioned in the Ext docs or found in the JS file itself in /libs/cq/ui/widgets/..


Found it on dev.day.com - http://dev.day.com/content/kb/home/cq5/Development/HowToCreateCustomClientLib.html

Simply put, override the ExtJS widget with your own. Not ideal but it'll do.

0

精彩评论

暂无评论...
验证码 换一张
取 消