copyBlockToClipboard and pasteBlockFromClipboard error

I’m trying to setup mygrid to allow for copy and paste based on your example:



dhtmlx.com/docs/products/dhtmlxG … 7298932000





I added the onKeyPressed function, I added



mygrid.enableBlockSelection(true);

mygrid.attachEvent(“onKeyPress”,onKeyPressed);



and I can highlight a selection of cells, but whenever I try to copy I get an IE error “Object doesn’t support this property or method”. Is this part of a professional only or do I have a configuration conflict?



Thanks for your assistance.

To use enableBlockSelection() methos you should to include file dhtmlxgrid_selection.js which is part of standard version

I’m using that,



but it still doesn’t work. As soon as I press Ctrl-C or Ctrl-V it fails.

function onKeyPressed(code,ctrl,shift){
    if(code==67&&ctrl){
        mygrid.copyBlockToClipboard()
    }
    if(code==86&&ctrl){
        mygrid.pasteBlockFromClipboard()
    }       
    return true;
}

It seems to fail on the mygrid.copyBlockToClipboard() statement.

I tried removing that line and replaced it with alert(‘hi’); and that worked.

Thanks

To use operation with clipboard you also should attach file

That was the missing piece. Thanks! Was that in the documentation somewhere?

You can check what file does method require here dhtmlx.com/docs/products/dhtmlxG … grid_api_a

The copying works well and I paste it into Excel fine, but it doesn’t copy the background colors or formating. Is  there a way to do that?

Thanks

Unfortuanately there is no way to copy row’s style to the csv format. You are able to copy just cell’s values

Thanks for letting me know.