The easyUI binding shortcut menu is displayed on the Data row

Source: Internet
Author: User

The div of the display data of easyUI has a style, such

All tables have a datagrid-cell style, so we can use jquery to bind time.
The following is the main js Code:

[Javascript]/* Right-click binding */
$ (". Datagrid-cell"). live ('textmenu ', function (e ){
// Display the shortcut menu
$ ('# Mm'). menu ('show ',{
Left: e. pageX,
Top: e. pageY
});

Return false;
});
/* Right-click the binding */
$ (". Datagrid-cell"). live ('textmenu ', function (e ){
// Display the shortcut menu
$ ('# Mm'). menu ('show ',{
Left: e. pageX,
Top: e. pageY
});

Return false;
}); Below is the HTML code of the menu:


[Html] <! -- Menu -->
<Div id = "mm" class = "easyui-menu" style = "width: 120px;">
<Div> New </div>
<Div>
<Span> Open </span>
<Div style = "width: 150px;">
<Div> <B> Word </B> </div>
<Div> Excel </div>
<Div> PowerPoint </div>
</Div>
</Div>
<Div iconCls = "icon-save"> Save </div>
<Div class = "menu-sep"> </div>
<Div> Exit </div>
</Div>

This setting will be displayed on the table:

Look at the non-Table location:

 
 


From yhc13429826359


 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.