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 09:36 AM UTC

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.
Up arrow icon