Liferay 颜色选择器不';行不通

Liferay 颜色选择器不';行不通,liferay,yui,liferay-6,color-picker,Liferay,Yui,Liferay 6,Color Picker,我使用Liferay 6.1,创建了一个带有代码的portlet(链接:) jQuery(function(){var colorPicker=new Liferay.colorPicker({hasImage:true});}); /color.png“title=”“vspace=“0”width=“18”style=“光标:指针;" /> 但它不起作用,请帮助我:)您需要将更多选项传递给新的Liferay.ColorPicker。根据您发布的指南: 选项: •上下文(对象):一个DOM对

我使用Liferay 6.1,创建了一个带有代码的portlet(链接:)

jQuery(function(){var colorPicker=new Liferay.colorPicker({hasImage:true});});
/color.png“title=”“vspace=“0”width=“18”style=“光标:指针;" />

但它不起作用,请帮助我:)

您需要将更多选项传递给新的Liferay.ColorPicker。根据您发布的指南:

选项:

•上下文(对象):一个DOM对象,它指定 搜索项目的步骤
•hasImage:(布尔)如果设置为true,则使用 “item”参数或任何图像都具有。使用颜色选择器类作为 图像
•项:(对象|字符串):DOM对象或jQuery选择器 指定将所选值插入到哪个字段的字符串
•onChange(Function):每当 颜色变化
•onClose(函数):将被调用的函数 当颜色选择器关闭时


hi Stijin,我认为上面的代码将显示colorpicker,但它只显示inputtext和图像,而不显示colorpicker,我需要传递更多选项?hi Stijin,liferay 6.0工作代码(链接:):)但我不知道为什么上面的代码不能像wiki那样工作:|该链接说您必须使用AUI才能工作。您发布的代码没有使用AUI。。。
<script type="text/javascript"> jQuery( function() { var colorPicker = new Liferay.ColorPicker( { hasImage: true } ); } ); </script>


<tr> <td> <input class="text-input" id="color" name="color" size="9" type="text" value="" />

<img align="absmiddle" alt="<liferay-ui:message key="color" />" border="0" class="use-color-picker" height="18" hspace="0" src="<%= themeDisplay.getPathThemeImages() %>/color.png" title="<liferay-ui:message key="color" />" vspace="0" width="18" style="cursor: pointer;" />

</input> </td> </tr>