You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well, that's simple: Just don't use an input field but some <div>.
So in your $('.color').colorPicker({... ) the selector .color is not an input field but something different. You still need to send the value from an input field,... so you need a <input type="hidden" ...> and put the value of it in the renderCallback.
To find this hidden input field in your callback you need to put it as a sibling of the other element and go like:
renderCallback: function($elm,toggled){if(toggled===true){// simple, lightweight check// ... like an open callback}elseif(toggled===false){var$input=$elm.parent().find('input');varinputName=$input.attr('name');varinputValue=$elm.val();$input.val(inputValue);
...
}}
...You need to update the colorPicker again to make this work because I modified the fix from yesterday a bit.
This is like the colored gray boxes underneath the input fields in the demo...
Good luck
Thanks for that. Will try tomorrow. Might get more complicated than that though. As the css is all done by jquerymobile and I've got the ui-field-contain option. So just using a div would take the whole line and not have the label.
As a short cut interim measure can u set the text colour to be the same as the background?
OK, then just do your stuff first and then make the color transparent:
renderCallback: function($elm,toggled){if(toggled===true){// simple, lightweight check// ... like an open callback}elseif(toggled===false){var$input=$elm.parent().find('input');varinputName=$input.attr('name');varinputValue=$elm.val();
...
$.post("data.esp",JSON.stringify(data);$elm.css({'color': 'transparent'});// won't see a thing ;o)
...
}}
Hi @sticilface,
I just introduced a new callback function that can help with your issue. It's called positionCallback and is called when the colorPicker is triggered or when you scroll right before it shows. This is good for many things like positioning more flexible, even inside custom containers, or in your case, to show numbers in the input field only when the colorPicker is active:
wow, cheers! I'm stuck in the middle of some toolchain issues.. and need to delve back into this project to fix it... I'll get back to you in a few days if that is ok?
Activity
PitPik commentedon Dec 15, 2015
Well, that's simple: Just don't use an input field but some
<div>.So in your
$('.color').colorPicker({...) the selector.coloris not an input field but something different. You still need to send the value from an input field,... so you need a<input type="hidden" ...>and put the value of it in therenderCallback.To find this hidden input field in your callback you need to put it as a sibling of the other element and go like:
...You need to update the colorPicker again to make this work because I modified the fix from yesterday a bit.
This is like the colored gray boxes underneath the input fields in the demo...
Good luck
sticilface commentedon Dec 16, 2015
Thanks for that. Will try tomorrow. Might get more complicated than that though. As the css is all done by jquerymobile and I've got the ui-field-contain option. So just using a div would take the whole line and not have the label.
As a short cut interim measure can u set the text colour to be the same as the background?
PitPik commentedon Dec 17, 2015
OK, then just do your stuff first and then make the color transparent:
Maybe a bit of a hack, but I hope it helps you...
sticilface commentedon Dec 18, 2015
That didn't quite work for me but close
This however, doesn't stop it when it is first constructed. Close enough for now though. Thanks for the help
PitPik commentedon May 19, 2016
Hi @sticilface,
I just introduced a new callback function that can help with your issue. It's called
positionCallbackand is called when the colorPicker is triggered or when you scroll right before it shows. This is good for many things like positioning more flexible, even inside custom containers, or in your case, to show numbers in the input field only when the colorPicker is active:You can also look it up in the ./demo/index.js (uncommented parts 1 to 3).
Let me know if this works for you
PitPik commentedon May 19, 2016
There is also a new method inside color that can return a string used in css (like 'rgba(123,234,12,1)' called
.toString().So, instead of
you can now write
or
if alpha (opacity) doesn't matter...
PitPik commentedon May 19, 2016
Hi @sticilface again,
I just found out that you don't even need the new callback:
This will also work for you...
sticilface commentedon May 19, 2016
wow, cheers! I'm stuck in the middle of some toolchain issues.. and need to delve back into this project to fix it... I'll get back to you in a few days if that is ok?