在这下边: 方法一 复代码 代码如下: <%@ 페이지 언어 ="C#" AutoEventWireup="true" CodeFile="gridContextMenu.aspx.cs" Inherits="gridContextMenu" %> 无标题页 <br>.panel_icon11 { background-image:url(images/first.gif)} <br>.center_icon { background-image:url(images/center.png)} <br> <본문> <br>함수 준비() <br>{ <br>var url = "jsonGrid.aspx?Param=select"; <br>var sm = new Ext.grid.CheckboxSelectionModel(); <br>var cm = new Ext.grid.ColumnModel <br>([ <br>sm,new Ext.grid.RowNumberer({header:"编号",width:50}), <br>{header:"编号",dataIndex:"ID",width:10,hidden:true}, <br>{header:"标题",dataIndex:"TypeCName",width:100,editor:new Ext.form.TextField()}, <br>{header:"英文name称",dataIndex:"TypeEName",width:100,editor:new Ext.form.TextField()}, <br>{header:"状态",dataIndex:"DelFlag",width: 100,renderer:function(value){if(value==false) {return "显示";} else {return "隐藏";}}}, <br>{header:"添加日期",dataIndex:"AddDate" ,width:100,renderer:Ext.util.Format.dateRenderer('Y年m月d日')} <br>]); <br>cm.defaultSortable = true; <br>var 필드 = <br>[ <br>{이름:"ID"}, <br>{이름:"TypeCName"}, <br>{이름:"TypeEName"}, <br>{이름:" DelFlag"}, <br>{name:"AddDate"} <br>]; <br>var store = new Ext.data.Store <br>({ <br>proxy:new Ext.data.HttpProxy({url:url}), <br>reader:new Ext.data.JsonReader({totalProperty :"totalPorperty",root:"root",fields:fields}) <br>}); <br>store.load({params:{start:0,limit:12}}); <br>var pagingBar = new Ext.PagingToolbar <br>({ <br>displayInfo:true, <br>emptyMsg:"没有数据显示", <br>displayMsg:"显示从{0}条数据到{1}条数据,共{2}条数据", <br>store:store, <br>pageSize:12 <br>}); <br>var Grid = new Ext.grid.GridPanel <br>({ <br>id:"MenuGridPanel", <br>renderTo:document.body, <br>layout:"fit", <br>frame:true , <br>테두리:true, <br>너비:600, <br>높이:360, <br>autoScroll:true, <br>store:store, <br>sm:sm, <br>cm:cm, <br>viewConfig:{forceFit: true}, <br>title:'<img style="height:auto; width:auto;" src="images/first.gif" />系列之--右键菜单', <br>bbar:pagingBar <br>}); <br>grid.on("rowcontextmenu",function(grid,rowIndex,e) <br>{ <br>e.preventDefault();if(rowIndex<0){return;} <br>var treeMenu = new Ext .menu.Menu <br>([ <br>{xtype:"button",text:"添加",icon:"Images/Icons/button/add.gif",pressed:true,handler:function(){} }, <br>{xtype:"button",text:"编辑",icon:"Images/Icons/button/delete.gif",pressed:true,handler:function(){}}, <br>{xtype :"button",text:"隐藏",icon:"Images/Icons/arrow-down.gif",pressed:true,handler:function(){}}, <br>{xtype:"button",text: "显示",icon:"Images/Icons/arrow-up.gif",pressed:true,handler:function(){}}, <br>{xtype:"button",text:"删除",icon:" Images/Icons/button/cross.gif",pressed:true, handler:function(){}}, <br>{xtype:"button",text:"上传图 Images",icon:"Images/Icons/plugin_add. gif",pressed:true,handler:function(){}} <br>]); <br>treeMenu.showAt(e.getPoint()); <br>}); <br>} <br> <br>Ext.onReady(준비); <br>