google-code-export / jpicker

Automatically exported from code.google.com/p/jpicker
1 stars 0 forks source link

Using quicklist #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi there, 
Thanks for such a nice plugin. It is pretty awesome. Hope you can help me
with some config. I am trying to populate the quicklist with a users
favourite colours that are stored in the database and based on passed
selections. However the following code does not work. Can you help please ;) ? 

var  paletteArray = [new $.jPicker.Color({hex:'A32929'}),new
$.jPicker.Color({hex:'B1365F'}),new $.jPicker.Color({hex:'7A367A'}),new
$.jPicker.Color({hex:'5229A3'}),new $.jPicker.Color({hex:'29527A'}),new
$.jPicker.Color({hex:'2952A3'}),new $.jPicker.Color({hex:'1B887A'}),new
$.jPicker.Color({hex:'28754E'}),new $.jPicker.Color({hex:'0D7813'}),new
$.jPicker.Color({hex:'528800'}),new $.jPicker.Color({hex:'88880E'}),new
$.jPicker.Color({hex:'AB8B00'}),new $.jPicker.Color({hex:'BE6D00'}),new
$.jPicker.Color({hex:'B1440E'}),new $.jPicker.Color({hex:'865A5A'}),new
$.jPicker.Color({hex:'705770'}),new $.jPicker.Color({hex:'4E5D6C'}),new
$.jPicker.Color({hex:'5A6986'}),new $.jPicker.Color({hex:'4A716C'}),new
$.jPicker.Color({hex:'6E6E41'}),new $.jPicker.Color({hex:'8D6F47'})]; 

 $(document).ready(
    function()
    {
        $('#palette').jPicker({
            window:{
                expandable: true, 
                position:{
                    x: 'left', 
                    y: 'bottom'
                }
            },
            color:{
                alphasupport:true, 
                active: new $.jPicker.Color({ a: 100}) ,
                quicklist: paletteArray
            }, 
            images:{
            clientPath: '/images/colorpicker/' 
            }
        }
        );
    });

Original issue reported on code.google.com by spiro.st...@gmail.com on 27 Nov 2009 at 4:43

GoogleCodeExporter commented 9 years ago
Sorry about the delay in response, I did not receive any email notification 
that this
was reported. Have to check those settings.

It looks like what your are trying to do should work just fine, but pay 
attention to
the case of the "quickList" setting. You have it all lowercase in your code 
example,
which would create a new object with a different name than that used for the 
list of
colors as the "L" in the quickList variable is a capital letter.

Original comment by christop...@gmail.com on 29 Dec 2009 at 5:02

GoogleCodeExporter commented 9 years ago

Original comment by christop...@gmail.com on 29 Dec 2009 at 5:03