(14) ExtJS의 Ext.form.field.트리거 트리거 필드

2768 단어
JS 파일:
//6:Trigger
Ext.onReady(function(){

	var testForm=new Ext.form.Panel({
		title:'Ext.form.field.Trigger ',
		bodyStyle:'padding:5',
		frame:true,
		height:100,
		width:270,
		renderTo:'form',
		defaults:{// 
			labelSeparator:':',// 
			labelWidth:70,// 
			width:200,// 
			labelAlign:'left'// 
		},
		items:[{

			xtype:'triggerfield',
			id:'memo',
			fieldLabel:' ',
			hideTrigger:false,// 
			onTriggerClick:function(){
				var memo=testForm.getForm().findField('memo');// 
				alert(memo.getValue());// 
				Ext.getCmp('memo').setValue('test');
			}
		}]
	
});
});


JSP 파일:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'JS1.jsp' starting page</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">
	<!-- extjs  -->
	<link rel="stylesheet" type="text/css" href="js/extjs/resources/css/ext-all.css">
	<!-- extjs  -->
	<script type="text/javascript" charset="utf-8" src="js/extjs/ext-all-debug.js"></script>
	<!--   -->
	<script type="text/javascript" charset="utf-8" src="js/extjs/ext-lang-zh_CN.js"></script>
	
	<script type="text/javascript" charset="utf-8" src="base/009_text.js"></script>


  </head>
  
  
  <body style="margin:10px">
  	<div id="form"></div> 
  	<!--   -->
  	<div id="errorMsg"></div>
  </body>
</html>

좋은 웹페이지 즐겨찾기