日期:2014-05-16  浏览次数:20588 次

我的 ext grid 与 form 与 ajax 与 tab 与 window 例子
<%@ page language="java" pageEncoding="gbk"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>

    <input type="hidden" id="alert_title" value="提示" />
    <input type="hidden" id="sure_delete" value="你确定要删除?" />
    <input type="hidden" id="no_check" value="请选择一条记录!" />
    <input type="hidden" id="confirm_ok" value="确定" />
    <input type="hidden" id="confirm_cancel" value="取消" />
    <input type="hidden" id="form_label_name" value="名称" />
    <input type="hidden" id="form_label_output" value="输出" />
    <input type="hidden" id="form_label_desc" value="描述" />
    <input type="hidden" id="confirm_reset" value="重置" />
    <input type="hidden" id="button_add" value="添加" />
    <input type="hidden" id="button_edit" value="编辑" />
    <input type="hidden" id="button_delete" value="删除" />
    <input type="hidden" id="button_close" value="关闭" />
    <input type="hidden" id="table_id" value="编号" />
    <input type="hidden" id="table_name" value="名称" />
    <input type="hidden" id="table_output" value="输出" />
    <input type="hidden" id="table_desc" value="描述" />
  





												<jsp:include flush="true" page="label.jsp"></jsp:include>
												<c:if test="${elementtype == '9' }">
												<div id="ismatrix_div">
													<input type="button" id="havematrix" onclick="setDisabled('matrix_out_num','auto'),setDisabled('show-matrix-btn','auto')" value="<bean:message key="msg.page.capture.Matrix"/>" />
													<select id="matrix_out_num" name="matrix_out_num" disabled="disabled">
														<logic:iterate id="item" name="matrixoutlist">
															<option value="${item.url_name }">${item.name }</option>
														</logic:iterate>
													</select>
													<input type="button" id="show-matrix-btn" value="set" disabled="disabled" />
												</div>
												</c:if>
												<div id="matrix-set-win" class="x-hidden">
												    <div class="x-window-header"></div>
												    <div id="matrix-tabs">
												        <!-- Auto create tab 1 -->
												        <div class="x-tab" title="<bean:message key="msg.page.capture.Matrix"/>">
												             <div id="grid3" style="width: 100%;height: 100%">   
												        </div>
												    </div>
												</div>
   




/*
 * Ext JS Library 3.0 Pre-alpha
 * Copyright(c) 2006-2008, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */



Ext.onReady(function(){
	
    Ext.QuickTips.init();
    var fom = new Ext.form.FormPanel({
		// fileUpload:true,
		width : 400,
		height : 180,
		frame : true,
		plain : true,
		monitorValid:true,//绑定验证
		layout : "column",
		items : [{
			layout : "form",
			columnWidth : .5,
			labelWidth : 52,
			items : [{
						xtype : "hidden",
						validateOnBlur : false,
						id:"matrixoutid",
						name : "matrixoutid",
						msgTarget : "side"// 设置错误显示
					},{
						fieldLabel : getTextByInput('form_label_name'),
						xtype : "textfield",
						validateOnBlur : false,
						id:"matrixname",
						name : "matrixname",
						allowBlank : false,
						blankText : "不能为空!",
						msgTarget : "side"// 设置错误显示
					},  {
						fieldLabel : getTextByInput('form_label_output'),
						xtype : "textfield",
						validateOnBlur : false,
						id:"outputnum",
						name : "outputnum",
						rege