hkalbertl / jquery.appendGrid

The dynamic table input JavaScript plugin
https://appendgrid.azurewebsites.net
MIT License
148 stars 76 forks source link

color picker inside appendGrid #102

Closed karthiksd9 closed 7 years ago

karthiksd9 commented 7 years ago

Is it possible to add a color picker inside appendGrid column? If possible can you please show the code snippet of the same?

Thanks in advance :)

karthiksd9 commented 7 years ago

Well. I just saw there is a column type called 'color'. That should work for me.

It would be great if you add jquery-UI colorpicker type. Just like datepicker.

hkalbertl commented 7 years ago

Hi karthiksd9,

Yes. You can use color as the type of column. appendGrid will generate the default color input as provided by your web browser. You may take a look on the following example:

$('#tblAppendGrid').appendGrid({
    columns: [{
      name: 'name',
      display: 'Name'
    }, {
      name: 'color',
      display: 'Color',
      type: 'color'
    }]
  });

I guess you are talking about the color picker in jQuery UI ThemeRoller. I am afraid it is not an UI Widget and I cannot find out the binary for it.

I believe there are several color picker plugin on Internet. You may choose one of them and make use of CustomType to generate color input in your grid. Hope it can help. Thanks!

karthiksd9 commented 7 years ago

Thanks @hkalbertl . That's very helpful :)