Home > Web Front-end > JS Tutorial > body text

Ext grid adds right-click menu_YUI.Ext related

WBOY
Release: 2016-05-16 18:41:04
Original
1156 people have browsed it
Copy code The code is as follows:

grid . addListener ( 'rowcontextmenu' , rightClickFn ); // Right-click menu Key part of the code
//Menu creation
var rightClick = new Ext . menu . Menu ({
id : 'rightClickCont' , // There must be a DIV element of rightClickCont in the HTML file
items : [{
id : 'rMenu1' ,
handler : rMenu1Fn , // Event triggered after clicking
text : 'Right-click menu 1'
}, {
id : 'rMenu2' ,
handler : rMenu2Fn ,
text : 'Right-click menu 2'
}]
});
function rightClickFn ( grid , rowindex , e ){
e . preventDefault () ;
rightClick . showAt ( e . getXY ());
}
function rMenu1Fn (){
Ext . MessageBox . alert ( 'right' , 'Right-click menu 1 was clicked' );
}
function rMenu2Fn (){
Ext . MessageBox . alert ( 'right' , 'Right-click menu 2 was clicked' );
}
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template