1. แสดงตาราง
http://img.blog.csdn.net/20140622133941015?watermark/2/Text/AHR0CDOVL2JSB2CUY3NKBI5UZXQVY WRHBV93ENM =/FONT/5A6L5L2T/FONTSIZE/400/FILL/I0JBQKFCMA ==/ละลาย/70/แรงโน้มถ่วง/ตะวันออกเฉียงใต้ <%@ ภาษาหน้า = "java" import = "java.util.*" pageencoding = "utf-8"%> <! doctype html สาธารณะ "-// w3c // dtd html 4.01 transitional // en"> <html> <head> href = "./ extjs4.1/resources/css/ext-all.css"> <script type = "text/javascript" src = "./ extjs4.1/ext-all-debug.js"> </script> <script type = "text/javascript <script type = "text/javascript"> ext.onready (function () {// กำหนดตาราง var grid = new ext.grid.panel ({คอลัมน์: [{text: 'หมายเลขบรรทัด'}, {ข้อความ: 'หมายเลขนักเรียน'}, {text: 'name' 'ภาษาอังกฤษ'}]}); // กำหนดหน้าต่าง var window = ext.create ("ext.window.window", {ชื่อเรื่อง: 'ตารางคะแนนนักเรียน', ความกว้าง: 600, ความสูง: 400, รายการ: กริด, เลย์เอาต์: 'พอดี' // หน้าต่างไฟล์}); // แสดงหน้าต่างหน้าต่าง show (); - </script> </head> <body> แสดงตาราง <br> </body> </html>2. แสดงข้อมูลท้องถิ่น
<%@ page language = "java" import = "java.util.*" pageencoding = "utf-8"%> <! doctype html public "-// w3c // dtd html 4.01 transitional // en"> <html> type = "text/css" href = "./ extjs4.1/resources/css/ext-all.css"> <script type = "text/javascript" src = "./ extjs4.1/ext-all-debug.js"> </script> src = "./ extjs4.1/locale/ext-lang-zh_cn.js"> </script> <script type = "text/javascript"> ext.onready (ฟังก์ชั่น () {// โมเดลข้อมูลที่กำหนดเอง var mymodel = ext.define ("studentInfo" }, {ชื่อ: 'stuname', ประเภท: 'String'}, {ชื่อ: 'Stuclass', ประเภท: 'String'}, {ชื่อ: 'chscore', ประเภท: 'number'}, {ชื่อ: 'mascore' data var mydata = [['no1', 'wangzs1', 'เกรด 1', 80, 67, 49], ['no2', 'wangzs2', 'เกรด 2', 65, 57, 79], [',', ',', '4', ',' 4 ',' 4 ' 19], ['No5', 'Wangzs5', 'เกรด 5', 23, 97, 99], ['No6', 'Wangzs6', 'เกรด 6', 34, 67, 99],]; var mystore = ext.create ("ext.data.store", {model: 'studentInfo', ข้อมูล: myData}); // table var mygrid = new ext.grid.panel ({คอลัมน์: [{xtype: 'rownumberer', ข้อความ: 'หมายเลขบรรทัด'}, {text: 'stunumber', dataindex: 'stuno'}, {text: 'name' DataIndex: 'Chscore'}, {text: 'Mathematics', DataIndex: 'Mascore'}, {text: 'English', DataIndex: 'Enscore'}], Store: Mystore}); // window var window = ext.create ("ext.window.window", {title: 'ตารางเกรดนักเรียน', ความกว้าง: 600, ความสูง: 400, รายการ: mygrid, เลย์เอาต์: 'พอดี'}); window.show (); - </script> </head> <body> แสดงข้อมูลท้องถิ่น <br> </body> </html>3. แสดงข้อมูล JSONP ข้ามโดเมน
<%@ page language = "java" import = "java.util.*" pageencoding = "utf-8"%> <! doctype html public "-// w3c // dtd html 4.01 transitional // en"> <html> type = "text/css" href = "./ extjs4.1/resources/css/ext-all.css"> <script type = "text/javascript" src = "./ extjs4.1/ext-all-debug.js"> </script> src = "./ extjs4.1/locale/ext-lang-zh_cn.js"> </script> <script type = "text/javascript"> ext.onready (function () {// โมเดลข้อมูลที่กำหนดเอง var jsonpmodel = ext.define ("jsonpmodel" 'String'}, {ชื่อ: 'ชื่อผู้ใช้', ประเภท: 'สตริง'}, {ชื่อ: 'dateline', ประเภท: 'สตริง'}, {ชื่อ: 'ชื่อ', ประเภท: 'สตริง'}]}); พร็อกซี: {ประเภท: 'jsonp', url: 'http://www.sencha.com/forum/topics-browse-remote.php', ผู้อ่าน: {TotalProperty: 'TotalCount', รูท: 'หัวข้อ'}}, autoload: จริง // // table var mygrid = new ext.grid.panel ({คอลัมน์: [{xtype: 'rownumberer', ข้อความ: 'หมายเลขบรรทัด'}, {text: 'userId', dataIndex: 'userId'}, {text: 'title', datainedex: 'title'}], store: mystore, bbar: {// กำหนดค่าการเพจที่ด้านล่างของตาราง xtype: 'pagingtoolbar', ร้านค้า: mystore, displayinfo: true}}); // window var window = ext.create ("ext.window.window", {title: 'ตารางเกรดนักเรียน', ความกว้าง: 600, ความสูง: 400, รายการ: mygrid, เลย์เอาต์: 'พอดี'}); window.show (); - </script> </head> <body> แสดงข้อมูล Cross-Domain JSONP <br> </body> </html>