extjs 제어 단추 표시 여부

3710 단어 ExtJs
 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title> </title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" />
		<script type="text/javascript" src="extjs/ext-base.js" /></script>
		<script type="text/javascript" src="extjs/ext-basex.js" /></script>
		<script type="text/javascript" src="extjs/ext-all.js" /></script>
		<script type="text/javascript" src="extjs/ext-lang-zh_CN.js"></script>
		<script type="text/javascript">
		var _window;
		Ext.onReady(function() {
			Ext.onReady(function(){   
				      _window=new Ext.Window({   
				         title:"New Person",   
				         width:500,   
				         height:100,   
				         plain:true,   
				         items:[{   
				             baseCls:"x-plain",   
				             layout:"column",   
				             items:[{   
				                     columnWidth:.5  
				                 },   
				                 {   
				                     columnWidth:.5   
				                 }   
				             ]   
				         }],   
				         buttons:[   
				             {text:"OK",
					          value:2,
					          
				              handler:function(){  
					                 a(_window);
				              }},   
				             {text:"Cancel",
						      value:1,
						      disabled:false,
					          handler:function(){  
					            		 alert(_window.buttons[1].value);
					          }}    
				         ]   
				     });   
				     _window.show();   
				 }); 

		});
		getManager();
	     // 
	    function getManager(){// id
	    	Ext.Ajax.request({
	  		   url: 'index4_json.jsp',
	  		   success: function(res){
	  		        //Ext.Msg.alert(" ",res.responseText);
	  		        var jsonResult = Ext.util.JSON.decode(res.responseText);
	  		        Ext.Msg.alert(" ",jsonResult.manager.name);
	  		        if('sammor'==jsonResult.manager.name){
	  		        	_window.buttons[1].disabled=true;
	  		        	_window.buttons[0].disabled=true;
		  		     }
	  	  		},
	  		   failure: function(){
	  		        Ext.Msg.alert(" "," ");
	  	  		}
	  		});
	    }

		function a(_window){
			alert(_window.buttons[0].value);  
   		 	_window.buttons[0].disabled=true;
		}
</script>
	</head>
	<body>
	</body>
</html>

 
<%
String str= "{'manager':{'name':'sammor','userId':1002}}";
out.print(str);
%>
 

좋은 웹페이지 즐겨찾기