Thanks Sematik for the clarification. I have another related question:
Is there a compatibility issue between Grouping and copying block data. When I tried to group the data and then copy using selection block(Ctrl+c), I got whole table data sometimes(data of collapsed groups).
Hey Sematik… I was able to get the cell data from grid using context menu…
Following is what i used for menu:
this.DHTMLXGrid.menu = new dhtmlXMenuObject();
this.DHTMLXGrid.menu.renderAsContextMenu();
this.DHTMLXGrid.menu.addNewChild(null, 0, “copy”, “Copy Cell Data”, false);
this.DHTMLXGrid.menu.setContextMenuHideAllMode(false);
this.DHTMLXGrid.enableContextMenu(this.DHTMLXGrid.menu);
this.DHTMLXGrid.attachEvent(“onKeyPress”, KeyboardCopy);
this.DHTMLXGrid.menu.attachEvent(“onClick”, function(menuitemId, type)
{
OnMenuItemClick(gridInfo);
});
function OnMenuItemClick(gridInfo)
{
var data = window[gridInfo.elementName].DHTMLXGrid.contextID.split("_");
window[gridInfo.elementName].DHTMLXGrid.cellToClipboard(data[0], data[1]);
//window[gridInfo.elementName].DHTMLXGrid.selectCell(data[0]-1, data[1], true, true);// (Commented out)
return true;
}
Above code works fine… But, only when I don’t select or highlight the current cell.
The moment I use following LOC and filter or sort data, the whole logic breaks:
window[gridInfo.elementName].DHTMLXGrid.selectCell(data[0]-1, data[1], true, true);
Reason: Cells shift after sorting or filtering.
Please Advise, how can I select the cell with context menu…
selectCell method uses the row_index not the row id.
You may get the index of the row:
var rowIndex=myGrid.getRowIndex(data[0]);
and use it in the selectCell method:
var rowIndex=window[gridInfo.elementName].DHTMLXGrid.getRowIndex(data[0]);
window[gridInfo.elementName].DHTMLXGrid.selectCell(rowIndex, data[1], true, true);
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan