Hi ,
i want to cut the content of a selected single cell / selected block . using ctrl + x combinatin. any idea’s ???
Try to add this to your code:
function onKeyPressed(code,ctrl,shift){
//ctrl+c - copy
if(code==67&&ctrl){
if (!mygrid._selectionArea) return alert("You need to select a block area in grid first");
mygrid.setCSVDelimiter("\t")
mygrid.copyBlockToClipboard()
}
// ctrl+v - paste
if(code==86&&ctrl){
mygrid.pasteBlockFromClipboard()
}
// ctrl+x - cut
if(code==88&&ctrl){
if (!mygrid._selectionArea) return alert("You need to select a block area in grid first");
mygrid.setCSVDelimiter("\t")
mygrid.copyBlockToClipboard()
topr=mygrid.getSelectedBlock().LeftTopRow
botr=mygrid.getSelectedBlock().RightBottomRow
lcol=mygrid.getSelectedBlock().LeftTopCol
rcol=mygrid.getSelectedBlock().RightBottomCol
var i,j
for (i=topr;i<=botr;i++){
for (j=lcol;j<=rcol;j++){
mygrid.cells2(i,j).setValue("")
}
}
}
return true;
}
thank you… but its not working . its giving error as
mygrid.getSelectedBlock is not a function
[Break On This Error] topr=mygrid.getSelectedBlock().LeftTopRow;
do i need to import any .js file ??
In your first post you told about the
content of selected block
Make sure that you have enabled block selection:
mygrid.enableBlockSelection();
Also make sure that you have added dhtmlxgrid_selection.js to your code.
yes just verified again. i am able to copy & paste the data . except cut.
Unfortunately issue can’t be reconstructed locally.
If issue still occurs for you - please provide any kind of sample or demo link where it can be reconstructed.