Context menu on right click using angular

Posted by: kvk04101985 on 25 September 2017, 10:44 pm EST

    • Post Options:
    • Link

    Posted 25 September 2017, 10:44 pm EST - Updated 11 January 2024, 5:42 am EST

    Hi Team,

    we are using spreadsheets 10 with angular js and we have a requirement to add context menu on right click to the cells. How can we proceed? Please provide some examples.

    Thanks,

    KVK.

  • Posted 25 September 2017, 10:44 pm EST

    Hello,

    This is the documentation page for using Angular with Spread.Sheets:

    http://sphelp.grapecity.com/webhelp/SpreadSheets10/webframe.html#angular.html

    In addition, I’ve attached a sample that shows how to use the two together as well.

    In regards to showing a context menu on right-click, Spread.Sheets does not have any context menus built into it, so you would need to write your own code for that. However, the code in this documentation page should be useful in determining which cell is being clicked on:

    http://sphelp.grapecity.com/webhelp/SpreadSheets10/webframe.html#scxyindex.html

    The only difference is that the code in that page is for left-clicking, so it would need to be changed a little to something like this for right-clicking:

    https://stackoverflow.com/questions/1206203/how-to-distinguish-between-left-and-right-mouse-click-with-jquery

    Let me know if that helps.

    In addition, please do not submit multiple forum posts for the same issue.

    Regards,

    Kevin

    2017/06/sjs-angula2-demo.zip

  • Posted 26 July 2018, 8:03 pm EST

    var spread = new GC.Spread.Sheets.Workbook(document.getElementById(“ss”), { sheetCount: 1 });

     var selectWithABackgroundColor = {
    		   text: 'Open Dialog',
    		   name: 'openDialog',
    		   command: showLoginDialog,
    		   workArea: 'viewport'//rowHeader
    		};
    		spread.contextMenu.menuData.push(selectWithABackgroundColor);
    		function showLoginDialog() {
    		   alert('gg');
    		}
    	$.each(spread.contextMenu.menuData, function (p, v) {
    	if (v.name === 'openDialog') {  
    		spread.contextMenu.menuData.splice(0,p-1)
    	}
    });
    
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels