3.2.0

Right Click Functionality

Is there any option for adding right click functionality on activewidgets table or how I can add right click on a row of the table
Sandeep Saha
July 18,
The following code will copy the contents of the current cell to your clipboard. You should be able to work from there.

// assign html event handler to row template
  table.getCellTemplate().setEvent("oncontextmenu", raiseMenuEvent);

  // assign grid event handler
  table.onCellContextMenu = function(event, col, row){
     holdtext.innerText = table.getCellValue(col,row);
     Copied = holdtext.createTextRange();
     Copied.execCommand("Copy");
  }
Mike
July 18,
Well, that didn't answer the question.

how I can add right click on a row of the table?
Rob
August 10,
http://www.activewidgets.com/javascript.forum.12947.7/how-to-properly-set-oncontextmenu.html

// html event handler translates to grid events
    function raiseMenuEvent(event){
        this.raiseEvent("onRowContextMenu", event, this.$0);
    }

    // assign html event handler to row template
    obj.getRowTemplate().setEvent("oncontextmenu", raiseMenuEvent);


    // assign grid event handler
    obj.onRowContextMenu = function(event, row){
        alert("row=" + row + " x=" + event.clientX + " y=" + event.clientY);
    }
Alex (ActiveWidgets)
August 11,

This topic is archived.

See also:


Back to support forum