EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: rezzonico on February 10, 2020, 09:33:04 AM



Title: datagrid + editor.type = color
Post by: rezzonico on February 10, 2020, 09:33:04 AM
Hi all,

in the following example in the second column I have set "color" as editor type.
It doesn't work.

http://195.144.40.170/jeasyui/PPP.7

Thanks
Miche


Title: Re: datagrid + editor.type = color
Post by: jarry on February 11, 2020, 08:46:57 PM
You should extend the color editor before using it in the datagrid component.
Code:
$.extend($.fn.datagrid.defaults.editors, {
  color: {
    init: function(container,options){
      var input = $('<input>').appendTo(container);
      input.color(options);
      return input;
    },
    destroy: function(target){
      $(target).color('destroy')
    },
    getValue: function(target){
      return $(target).color('getValue')
    },
    setValue: function(target, value){
      $(target).color('setValue', value)
    },
    resize: function(target, width){
      $(target).color('resize', width)
    }
  }
})


Title: Re: datagrid + editor.type = color
Post by: rezzonico on February 12, 2020, 06:43:47 AM
Thanks a lot !
Miche