Sample: dhtmlxGrid | Colorpicker eXcell | dhtmlxGrid main page |
You can implement Colorpicker as cell editor
<div id="gridbox" width="600px" height="250px" style="background-color:white;overflow:hidden"></div> <script></script>mygrid = new dhtmlXGridObject('gridbox'); ... mygrid.setHeader("Color Name,Color"); mygrid.setInitWidths("80,*") mygrid.setColAlign("left,center") mygrid.setColTypes("ed,cp"); mygrid.setColSorting("str,str") ... mygrid.init(); mygrid.loadXML("colors.xml");
function doOnColorChanged(stage,rId,cIn){ if(stage==2){ if(cIn==0){ mygrid.cells(rId,1).setValue(mygrid.cells(rId,0).getValue()); }else if(cIn==1){ mygrid.cells(rId,0).setValue(mygrid.cells(rId,1).getValue()); } } return true; } mygrid.attachEvent("onEditCell",doOnColorChanged);
© DHTMLX LTD. All rights reserved |