Ext menu问题

Song小刚 2011-02-22

怎么让点出的菜单变为灰色

代码:

menu:new Ext.menu.Menu({
        items:[
         {
          text:'添加相册',
          id:'add',
          handler:function(){
           friends_form.getForm().findField('id').setValue(id);
           friends_form.getForm().findField('friendstree_id').setValue(crrentNode.id);
           friends_win.show();
          }
         },{
          text:'删除',
          id:'dele',
          handler:function(){
           Ext.Msg.confirm('msg','你确定删除内容',function(btn){
            if(btn=="yes"){
             if(crrentNode.hasChildNodes()||crrentNode.id=="photos_root"){
              if(crrentNode.id=="photos_root"){
               Ext.Msg.alert('msg','系统文件...不可删除..');
              }else{
               Ext.Msg.alert('msg','请先删除子节点...');
              }
             }else{
              Ext.Ajax.request({
               url:path+"friends?operation=upTree&op=dele&main=photos_tree",
               params:{friendstree_id:crrentNode.id},
               success:function(resp,opts){
                var result = Ext.util.JSON.decode(resp.responseText);
                if(result.success==true){
                 if(result.rest==true){
                  Ext.Msg.alert('msg','删除成功...');
                  crrentNode.remove();
                 }else{
                  Ext.Msg.alert('msg','删除失败...');
                 }
                }
               },
               failure:function(){
                Ext.Msg.alert('msg','连接服务器失败...');
               }
               
              });
             }
            }
           });
           
           
          }
         },{
          text:'修改名称',
          id:'up',
          handler:function(){
        if(crrentNode.id=="photos_root"){
         Ext.Msg.alert('msg','系统文件...不可修改....');
        }else{
         Ext.Msg.prompt('请输入要修改的名称','输入名称',function(btn,text){
          if(btn=="ok"){
           Ext.Ajax.request({
            url:path+"friends?operation=upTree&op=up&main=photos_tree",
            params:{text:text,friendstree_id:crrentNode.id},
            success:function(resp,opts){
             var result = Ext.util.JSON.decode(resp.responseText);
             if(result.success==true){
              if(result.rest==true){
               Ext.Msg.alert('msg','修改成功...');
               crrentNode.setText(text);
              }else{
               Ext.Msg.alert('msg','修改失败...');
              }
             }
            },
            failure:function(){
             Ext.Msg.alert('msg','连接服务器失败...');
            }
           });
          }
          
         },this,false,crrentNode.text);
         
        }
       }
         },{
          text:'上传相片',
          handler:function(){
           //photosForm.getForm().findField('imgId').setValue(id);
           //photosForm.getForm().findField('pid').setValue(crrentNode.id);
        photosWin.show();
          }
         }
        ]
       }),
    root:{
     nodeType:'async',
     id:'photos_root',
     text:'我的相册',
     url :'photos_list.jsp'
    },
    listeners:{
     contextmenu:function(node,n){
      var tab = center.getItem('Tab_'+node.id);
      if(tab){
       Ext.Msg.alert('msg','当前正在使用..不能进行操作...请先关闭');
       center.setActiveTab(tab);
      }else{
       crrentNode=node;
       this.menu.showAt(n.getXY());
      }
     },<!--StartFragment -->

Global site tag (gtag.js) - Google Analytics