EXTJS 动态菜单

if(buttonItems[i].buttonName=="[电子邮件]接收(可选地址)"){
				debugger;
				var url = ucapSession.baseAction + "?type=extMailAction&act=showEmailAddresses&rand="+Math.random();
				conn = window.top.Ext.lib.Ajax.getConnectionObject().conn;
				conn.open("POST", url, false);
				conn.send();
				var exjson = Ext.util.JSON.decode(conn.responseText);
				
				var menu1 = new Ext.menu.Menu(); 
				var menuList = new Array(); 
				for(var k=1;k<=exjson.length-1;k++){
					menuList[k-1]=exjson[k][0];
				}
				var mItem; 
				for(var j = 0 ; j < menuList.length ; j++){ 
					var address =menuList[j];
					mItem = new Ext.menu.Item({ 
						text:menuList[j], 
						handler:function(item){ 
							innerMailFunc.receive(item); 
						} 
					}); 

					menu1.add(mItem); 
				} 
				TBarJson += ",menu:'"+menu1.id+"'";
			}

 

 

你可能感兴趣的:(ExtJs)