Context menu on Right clicking

QuestionsCategory: How TosContext menu on Right clicking
DGea asked 5 years ago

Good morning sir Abu,

Is it possible to add menus to each row of data by right-clicking on the mouse?

Reference: https://imgur.com/OCk7gLu

Thank you so much

4 Answers
Abu Ghufran Staff answered 5 years ago

You can check this context menu demo.

See attached code for help, include JS/CSS files and connected loadComplete event.

Code: https://gist.github.com/gridphp/b5416f203fdac93623b614a5f455731c
Line 26,44,53

It uses following jQuery lib. To customize refer documentation there:
https://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
DGea answered 5 years ago

Thank you Sir.

But there are no examples of how to have links to other sites on each menu, based on the id of each row of data. Anyone can help?

Abu Ghufran Staff answered 5 years ago

Code updated at gist to use rowid and cell data.

https://gist.github.com/gridphp/b5416f203fdac93623b614a5f455731c

Line 61,62

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Abu Ghufran Staff answered 5 years ago

More explanation: if you want to open link on clicking certain menu.

If you click on (for e.g.) bravo, it would return its key there in callback.

See: https://i.imgur.com/sXx4F6y.png

Now there you can put if check and do window.open() e.g. see line 64
https://gist.github.com/gridphp/b5416f203fdac93623b614a5f455731c#file-phpgrid-context-menu-php-L64

var m = “Row:”+ row +”, Gender:”+gender+”, Clicked:” + key;
if (key == ‘fold2-key2’)
window.open(‘billing.php?param=’+gender);

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

19 + 6 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?