ExtJs入门

来源:互联网 发布:花桥爱知国际开发商 编辑:程序博客网 时间:2024/06/05 08:40

下载ExtJS,解压到项目与src统计目录中,启动tomcat,ExtJs文档的位置http://localhost:8080/项目名称/ExtJS

示例代码如下:

<%@ page language="java" contentType="text/html; charset=GBK"    pageEncoding="GBK"%><%    String path = request.getContextPath();    String basePath = request.getScheme() + "://"            + request.getServerName() + ":" + request.getServerPort()            + path + "/";%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK"><link rel="stylesheet" type="text/css"    href="<%=path%>/ExtJS/resources/css/ext-all.css" /><script type="text/javascript" src="<%=path%>/ExtJS/ext-all.js"></script><title>Insert title here</title></head><script type="text/javascript">    Ext.onReady(function() {        var updater = Ext.get('content-div').getLoader();        var btns = Ext.select('input');//选择页面中的所有input组件        btns.addListener('click', function(e, b) {//成批绑定click事件            update(b.value + '.html');//调用更新函数        });        //定义更新函数        function update(url) {            updater.load({//调用更新器的update方法,更新页面元素                url : url            });        }    })</script><BODY style="">    <div id="content-div"></div>    <input type=button value='111'>    <input type=button value='222'></BODY></html>


原创粉丝点击