How to copy row contents?

Dear community,
I tried copying the selected row by adding this code:

mygrid.attachEvent("onKeyPress",onKeyPressed); function onKeyPressed(code,ctrl,shift){ if(code==67&&ctrl){ mygrid.setCSVDelimiter("t"); mygrid.copyBlockToClipboard() } if(code==86&&ctrl){ mygrid.pasteBlockFromClipboard() } return true; }
Which is not a PRO function. However, it doesn’t seem to work.
What is meant by “block selection”? If I select a row and the whole row appears blue, is this not considered as block selection?
Cheers!

I’m sorry, I meant I have:
mygrid.enableBlockSelection(true);
And when I select a yellow area, and I try pressing command+c it won’t get copied to clipboard.
I also tried editing the code to:

    function onKeyPressed(code,[b]shift[/b]){
if(code==67&&[b]shift[/b]){
    mygrid.setCSVDelimiter("t");
    mygrid.copyBlockToClipboard()
}

To try and copy with only shift+c
and I also tried the e.metaKey, but nothing seems to work. =S
Any ideas?

The following sample works well:
dhtmlx.com/docs/products/dhtmlxG … ction.html

If the problem still occurs for you please, provide share with a demo link or provide with a complete demo, where the problem can be reconstructed locally.

Dear Sematik.
That sample actually doesn’t work for me…
I tried on a friends windows computer, and there it did work. Is this a function for windows only?
Is there something I can change to make the command key of a mac work as well?

Best regards!

I also tried this:

function onKeyPressed(code,codeb,shift){ if(code==67&&(codeb==91 || codeb==93)){ mygrid.setCSVDelimiter("t"); mygrid.copyBlockToClipboard() } if(code==86&&ctrl){ mygrid.pasteBlockFromClipboard() } return true; }
and this:

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

but nothing works.

Is this function only available for windows?

The following code works well for me on MAC OS:

function onKeyPressed(code,ctrl,shift){ if(event.metaKey){ if(code==67){ if (!myGrid._selectionArea) return alert("You need to select a block area in grid first"); myGrid.setCSVDelimiter("\t"); myGrid.copyBlockToClipboard() } if(code==86){ myGrid.setCSVDelimiter("\t"); myGrid.pasteBlockFromClipboard() } } return true; }

Sadly, that code doesn’t work. I have the exact same code snippet and when I mark a block and press cmd+c, it beeps (generic beep trying to use a keyboard shortcut when corresponding menu item isn’t available (copy, in this case).

The KeyboardEvent properties look fine:

{
 "altKey": false,
 "ctrlKey": false,
 "charCode": 0,
 "keyCode": 67,
 "location": 0,
 "metaKey": true,
 "shiftKey": false,
 "which": 67
}

I believe there is something wrong with

copyBlockToClipboard()

… on mac osx (El Capitan)

I take that half back … Safari seems to be the problem. The code above using metaKey does, indeed work in Firefox.

Is this a function for windows only?
Is there something I can change to make the command key of a mac work as well?

The following code works well for me on MAC OS:

function onKeyPressed(code,ctrl,shift){ if(event.metaKey){ if(code==67){ if (!myGrid._selectionArea) return alert("You need to select a block area in grid first"); myGrid.setCSVDelimiter("\t"); myGrid.copyBlockToClipboard() } if(code==86){ myGrid.setCSVDelimiter("\t"); myGrid.pasteBlockFromClipboard() } } return true; }