We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid whit color picker

Hi, I have the following problem with the color picker template. When you edit a row there are no problems with the control, but when I stop editing the row I can't make the control render and it remains in read-only format to show the selected color. Can I do that?  

https://stackblitz.com/edit/wsmvdn-i4nmfr?file=index.js

Best regards

1 Reply

TS Thiyagu Subramani Syncfusion Team January 17, 2020 01:36 AM

Hi Alex, 

Greetings from Syncfusion forum. 

We can achieve your requirement “Grid whit color picker” using rowDataBound event. Please  refer to the below code and sample link. 

function rowBound(args) { 
  if (args.data.color != undefined) { 
    args.row.cells[2].innerHTML = ""; 
    var cell = document.createElement('input'); 
    cell.id = "check"; 
    cell.type = "color"; 
    args.row.cells[2].appendChild(cell); 
    var colorObj = new ej.inputs.ColorPicker({ 
      value: args.data.color,  // you can set properties here.. 
      disabled: true 
    }); 
    colorObj.appendTo(cell); 
  } 


Help documentation link. 



Please get back to us, if you need any further assistance. 

Regards, 
Thiyagu S 


Loader.
Live Chat Icon For mobile
Up arrow icon