Foros de discusión

Pre-set color to AUI colorpicker

Mk Sin, modificado hace 11 años.

Pre-set color to AUI colorpicker

Junior Member Mensajes: 74 Fecha de incorporación: 25/05/12 Mensajes recientes
http://www.liferay.com/community/liferay-projects/alloy-ui/demo?title=community-liferay-projects-alloy-ui-demos-color-picker
Following that link, i know how to use colorpicker, and it work fine, but...
I dont know how to pre-set color in the picker( when click on the picker, colorpicker popup open with no color preset, the next times it will open with lastest color you picked)
Anybody can help me plz emoticon
thumbnail
Yaroslav Rudyy, modificado hace 11 años.

RE: Pre-set color to AUI colorpicker

New Member Mensajes: 2 Fecha de incorporación: 2/03/11 Mensajes recientes
Mk Sin:
http://www.liferay.com/community/liferay-projects/alloy-ui/demo?title=community-liferay-projects-alloy-ui-demos-color-picker
Following that link, i know how to use colorpicker, and it work fine, but...
I dont know how to pre-set color in the picker( when click on the picker, colorpicker popup open with no color preset, the next times it will open with lastest color you picked)
Anybody can help me plz emoticon



<aui:script use="aui-color-picker">
AUI().ready('aui-color-picker-base', function(A) {
var colorNode = A.one('#color');
window.colorPicker = new A.ColorPicker({
hex: colorNode.text(),
after: {
colorChange: function(val) {
var hex = '#' + this.get('hex');
colorNode.setContent('color: ' + hex);
colorNode.setStyle('backgroundColor', hex);
}
}
}).render('#demo');
});
</aui:script>