rowcontextmenu:function(grid,rowIndex,e){//右键菜单
                e.preventDefault();document.title=(rowIndex) //这里的index是每次点击的行
                if(menu==null){//为了节省资源,只创建一次
                    menu=new Ext.menu.Menu({
                        items:[{
                            text:msg.add,iconCls:"icon icon_add",
                            handler:showadd
                        },{
                            text:msg.edit,iconCls:"icon icon_edit",
                            handler:function(){document.title+=","+(rowIndex)//但是这里的index却始终是第一次点击的行,这是怎么回事啊,谁给解释下?
//到底要怎样才能在第二次点击时获取当然右键的行?
                                showedit(grid.getStore().getAt(rowIndex));
                            }
                        },{
                            text:msg.del,iconCls:"icon icon_del",
                            handler:function(){
                                showdel(grid.getStore().getRange(rowIndex,rowIndex))
                            }
                        }]            
                    });
                
                };
                menu.showAt(e.getPoint())grid的右键菜单 

解决方案 »

  1.   

    监听的哪个事件,如果是cellclick这个事件的话,应该是没问题的
      

  2.   

    谁让你只创建一次的啥,  你创建的时候顺带把handler也创建了把handler函数放到e.preventDefault();后面声明……呵呵,提前说好,我也不知道对不对哈……把你想得的方法都试一试……只要愿意想,任何难题都能想到解决办法的……