Grid的右键弹出菜单

Posted on 2008-12-12 17:36 Robert Su 阅读(684) 评论(0)  编辑  收藏 所属分类: Ajax
现在这个Grid的右键弹出菜单存在一个问题就是右键单击的时候无法直接选择Grid中的一行
    //right menu
            grid.on('rowcontextmenu', rightClickFn,grid);
            
var rightClick = new Ext.menu.Menu({
                id:'rightClickCont',
                items: [
                    {
                        id: 'rMenu1',
                        scope:
this,
                        text: '审核:1',
                        handler:
function(){auditWebVideoSecond(grid,1,true);}
                    },
                    {
                        id: 'rMenu2',
                        scope:
this,
                        text: '审核:2',
                        handler:
function(){auditWebVideoSecond(grid,2,true);}
                    },
                    {
                        id: 'rMenu3',
                        scope:
this,
                        text: '审核:3',
                        handler:
function(){auditWebVideoSecond(grid,3,true);}
                    },
                    {
                        id: 'rMenu4',
                        text:'审核:4',
                        scope:
this,
                        handler:
function(){auditWebVideoSecond(grid,4,true);}
                    }
                ]
            });
            
            
function rightClickFn(grid,rowIndex,e){
                e.preventDefault();
                rightClick.showAt(e.getXY());                    
            }
function auditWebVideoSecond(videoGrid,flag,change){
    
    
var datas = grid.getSelectionModel().getSelections();
    
if(datas.length <= 0)
        
return;

    
if(!inputwindow){
         
var form = new Ext.form.FormPanel({
                        
//baseCls: 'x-plain',
                        labelWidth: 55,
                        frame:
true,
                        id:'inputwindow_form',
                        items: [
                         {
                            xtype:'fieldset',
                            title: '处理建议',
                            collapsible: 
false,
                            autoHeight:
true,
                            width: 
350,
                            defaults: {width: 
330},
                            defaultType: 'textarea',
                            items: [{
                                hideLabel:
true,
                                xtype:'textarea',
                                name: 'remark',
                                height:
80,
                                id: 'remark'
                            }]},
                             {
                            xtype:'fieldset',
                            title: '节目来源',
                            collapsible: 
false,
                            autoHeight:
true,
                            width: 
350,
                            defaults: {width: 
330},
                            defaultType: 'textfield',
                            items: [{
                                hideLabel:
true,
                                xtype:'textarea',
                                height:
40,
                                name: 'program_source',
                                id: 'program_source'
                            }]},
                        {
                            xtype:'fieldset',
                            layout:'column',
                            id:'priority_group',
                            title: '节目重要程度',
                            collapsible: 
false,
                            autoHeight:
true,
                            width: 
350,
                            items: [
                            {
                                width:
60,
                                layout: 'form',
                               
// labelWidth: 10,
                                items: new Ext.form.Radio({id:'priority0',name:'priority',value:"",hideLabel:true,boxLabel:'无',checked:true})
                            },
                             {
                                width:
80,
                                layout: 'form',
                                
//labelWidth: 40,
                                items: [new Ext.form.Radio({id:'priority1',name:'priority',value:"0",hideLabel:true,boxLabel:'一般'})]
                            },
                             {
                                width:
80,
                                layout: 'form',
                                
//labelWidth: 40,
                                items: [new Ext.form.Radio({id:'priority2',name:'priority',value:"1",hideLabel:true,boxLabel:'重要'})]
                            }]                            
                            
                        }
                        ]
                    });
                    
                   inputwindow 
= new Ext.Window({
                                    title: '处理建议',
                                    width: 
400,
                                    height:
300,
                                    layout: 'fit',
                                    bodyStyle:'padding:10px;',
                                    buttonAlign:'center',
                                    resizable:
false,
                                    closeAction:'hide',
                                    modal:
true,
                                    items: form,
                                    buttons: [{
                                        text: '保存',
                                        id:'save_function',
                                   },{
                                                    text: '取消',
                                                    handler:
function(){
                                                        inputwindow.hide();
                                                    }
                                                }]
                                            });            
                                        
                                }
                 
   
if(flag =='1')
   inputwindow.setTitle('处理建议[1]');
   
else if(flag =='2')
   inputwindow.setTitle('处理建议[2]');
   
else if(flag =='3')
   inputwindow.setTitle('处理建议[2]');
   
else if(flag =='4')
   inputwindow.setTitle('处理建议[4]');
   inputwindow.show();
   

}



只有注册用户登录后才能发表评论。


网站导航:
 

posts - 103, comments - 104, trackbacks - 0, articles - 5

Copyright © Robert Su