Search the Community
Showing results for tags 'contextmenu'.
-
When Grid shows no rows the user can still invoke ContextMenu, if Grid contains row(s) then my current coding below disables ContextMenu. How do we prevent Grid ContextMenu with zero rows ? Please advise - thanks ////////////////////////////////////////////////////////////////////////////// // Before Container MyScript:= 'beforecontainercontextmenu=function beforecontainercontextmenu(sender, td, cellIndex, record, tr, rowIndex, e, eOpts) '#13#10 + '{ '#13#10 + ' e.preventDefault(); '#13#10 + '} '; grdWorkSheet.ClientEvents.ExtEvents.Add(MyScript); // Container MyScript:= 'containercontextmenu=function containercontextmenu(sender, td, cellIndex, record, tr, rowIndex, e, eOpts) '#13#10 + '{ '#13#10 + ' e.preventDefault(); '#13#10 + '} '; grdWorkSheet.ClientEvents.ExtEvents.Add(MyScript); // Row MyScript:= 'rowcontextmenu=function rowcontextmenu(sender, td, cellIndex, record, tr, rowIndex, e, eOpts) '#13#10 + '{ '#13#10 + ' e.preventDefault(); '#13#10 + '} '; grdWorkSheet.ClientEvents.ExtEvents.Add(MyScript); // Before Cell MyScript:= 'beforecellcontextmenu=function beforecellcontextmenu(sender, td, cellIndex, record, tr, rowIndex, e, eOpts) '#13#10 + '{ '#13#10 + ' e.preventDefault(); '#13#10 + '} '; grdWorkSheet.ClientEvents.ExtEvents.Add(MyScript); // Cell MyScript:= 'cellcontextmenu=function cellcontextmenu(sender, td, cellIndex, record, tr, rowIndex, e, eOpts) '#13#10 + '{ '#13#10 + ' e.preventDefault(); '#13#10 + '} '; grdWorkSheet.ClientEvents.ExtEvents.Add(MyScript); // Before Item MyScript:= 'beforeitemcontextmenu=function beforeitemcontextmenu(sender, td, cellIndex, record, tr, rowIndex, e, eOpts) '#13#10 + '{ '#13#10 + ' e.preventDefault(); '#13#10 + '} '; grdWorkSheet.ClientEvents.ExtEvents.Add(MyScript); // Item MyScript:= 'itemcontextmenu=function itemcontextmenu(sender, td, cellIndex, record, tr, rowIndex, e, eOpts) '#13#10 + '{ '#13#10 + ' e.preventDefault(); '#13#10 + '} '; grdWorkSheet.ClientEvents.ExtEvents.Add(MyScript); // Header MyScript:= 'headercontextmenu=function headercontextmenu(sender, td, cellIndex, record, tr, rowIndex, e, eOpts) '#13#10 + '{ '#13#10 + ' e.preventDefault(); '#13#10 + '} '; grdWorkSheet.ClientEvents.ExtEvents.Add(MyScript);
-
With a few code you can attach popups to any uniGUI control. But to make works exactly as Windows, you must walk a little more. Here is a simple example to attach context menu (mouse right-click) to any uniGUI control and create as you wish 'on- the-fly'. Very simple to use and customize. Features: * Tiny library. Only dependency is jQuery. * Simple API. * Looks good out of the box, with no additional tweaking. * Designed to look and behave like a standard Windows context menu. * There's so little code, it should be easy to add your own custom features. ContextMenu2uniGUI.mp4 Silver Package - 89 Projects Just $99,00 USD https://www.unigui.com.br/democetera/ This project/source-code is free to uniGUI subscriber and will be available here to download for the next few days. After that, only for sale. Link below. Don't DM me about it ! Visite http://www.unigui.com.br/ Nosso grupo no Telegram: Livros, packs de projetos, cursos, serviços, consultoria e tudo sobre unigui ! https://t.me/uniguiBrazil - Conteúdo em português ou/or See more and get this pack at http://www.unigui.com.br/democetera Our group at Telegram: https://t.me/uniguiexpress Content in English Project420-ContextMenu.rar
-
Please advise. I need "AfterRender" and MouseDown Button 2 InfoHTMLFrame.ClientEvents.ExtEvents.Clear; s:= 'afterrender=function afterrender(sender, eOpts) '#13#10+ '{'#13#10+ ' sender.getEl().dom.addEventListener(''contextmenu'', function(e) '#13#10+ ' { '#13#10+ ' e.preventDefault(); '#13#10+ ' }), '#13#10+ ' sender.getEl().dom.addEventListener(''mousedown'', function(e) '#13#10+ ' {'#13#10+ ' if (e.button == 2) '#13#10+ ' { '#13#10+ ' e.preventDefault(); '#13#10+ ' ajaxRequest(sender, ''_Right_Click_'', {x: e.offsetX, y: e.offsetY}); '#13#10+ ' } '#13#10+ ' }), '#13#10+ ' ajaxRequest(fMain.InfoHTMLFrame, ''_AfterRender_'', []); '#13#10+ '}'; InfoHTMLFrame.ClientEvents.ExtEvents.Add(s);
-
This code works WHEN NO POPUPMENU IS USED (no ContextMenu is ever shown as expected). If PopUpMenu is used (LeftMenu.Popup(x, y, LeftPanel);) no matter what I do I get the extra "Open In New Tab" window over the top of my PopUpMenu ? Please advise how to prevent "Open In New Tab" window when using PopUpMenu - Thanks in advance. s:= 'afterrender=function afterrender(sender, eOpts) '#13#10+ '{'#13#10+ ' sender.getEl().dom.addEventListener(''mousedown'', function(e) '#13#10+ ' {'#13#10+ ' if (e.target.tagName == ''IMG'' && e.button == 2) '#13#10+ ' { '#13#10+ ' t1 = e.target.getAttribute("data-tableId"); '#13#10+ ' c1 = e.target.getAttribute("data-caption"); '#13#10+ ' e.preventDefault(); '#13#10+ ' ajaxRequest(sender, ''_RightClick_'', {tableId: t1, cap: c1, x: e.offsetX, y: e.offsetY}); '#13#10+ ' } '#13#10+ ' }), '#13#10+ ' sender.getEl().dom.addEventListener(''contextmenu'', function(e) '#13#10+ ' { '#13#10+ ' e.preventDefault(); '#13#10+ ' }) '#13#10+ '}'; LeftHTMLFrame.ClientEvents.ExtEvents.Add(s);