EasyUI Forum
May 10, 2024, 09:27:58 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: datagrid + editor.type = color  (Read 3041 times)
rezzonico
Full Member
***
Posts: 183


View Profile
« 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
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #1 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)
    }
  }
})
Logged
rezzonico
Full Member
***
Posts: 183


View Profile
« Reply #2 on: February 12, 2020, 06:43:47 AM »

Thanks a lot !
Miche
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!