1. Покажите таблицу
http://img.blog.csdn.net/20140622133941015?watermark/2/ahr0cdovl2jsb2cuy3nkbi5uzxqvy Wrhbv93enm =/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma ==/растворить/70/гравитация/юго -восток <%@ Page language = "java" import = "java.util.*" pageencoding = "utf-8"%> <! Doctype html public "-// w3c // dtd html 4.01 transitional // en"> <html> <head> <title> my jsp 'index.jsp. href = "./ extjs4.1/resources/css/ext-all.css"> <script type = "text/javascript" src = "./ extjs4.1/ext-all-debug.js"> </script> <script type = "text/javascript" src = "./ extjs4.1/locale/ext-lang-zh_cn.js"> </script> <script type = "text/javascript"> ext.onready (function () {// define table var grid = new Ext.grid.panel ({columns: [{{} line 'number'}, {{text: '{{{{{{{} line'}, {{{{{{{{{{{{{{{},}, {{{{{{{{{{{{{{{{{{{}, ','}, ', {{}: {text: 'class'}, {text: 'китайский'}, {текст: 'математика'}, {text: 'English'}]}); // Показать Window Window.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> <Head> <tite> my jsp 'index.jsp' starmet </title> </title releele releeet letles letles letles> " type = "text/css" href = "./ extjs4.1/resources/css/ext-all.css"> <script type = "text/javascript" src = "./ extjs4.1/ext-debug.js"> </script> <script type = "javascript" src = "./ extjs4.1/locale/ext-lang-zh_cn.js"> </script> <script type = "text/javascript"> ext.onready (function () {// model data mymodel = ext.define ("studentinfo", {extend: 'ext.data.model = ext.define ("studentInfo", extend:' ext.data.model ', fields: 'string'}, {name: 'Stuname', type: 'string'}, {name: 'stuclass', type: 'string'}, {name: 'chscore', type: 'number'}, {name: 'mascore', type: 'number'}, {name: 'anscore', type: 'number'}, {name: 'inscore:' incore: 'incore:') // Локальные данные var mydata = [['no1', 'wangzs1', 'класс 1', 80, 67, 49], ['no2', 'wangzs2', '2 класс 2', 65, 57, 79], [no3 ',' wangzs3 ', класс 3', 45, 77, 59], [no4 '', 'wangs3', класс 3 ', 45, 77, 59], [no4' ',' wangs3 ', класс 3', 45, 77, 59], [no4 '', 'wangs3', класс 3 ', 45, 77, 59]. 99, 27, 19], ['no5', 'wangzs5', '5 класс, 23, 97, 99], [' no6 ',' wangzs6 ',' 6 класс, 34, 67, 99],]; var mystore = ext.create ("ext.data.store", {model: 'StudentInfo', Data: myData}); // Таблица var mygrid = new ext.grid.panel ({columns: [{xtype: 'rownumberer', text: 'number'}, {text: 'stunumber', dataindex: 'stuno'}, {text: 'name', dataindex: 'stuname'}, {{text: 'class', class ', dataindex:' stunam «Китайский», DataInDex: 'chscore'}, {text: 'Mathematics', DataInDex: 'Mascore'}, {text: 'english', datainDex: 'enscore'}], store: mystore}); // window var window = ext.create ("ext.window.window", {title: 'таблица класса учеников', ширина: 600, высота: 400, пункты: mygrid, макет: 'fit'}); window.show (); }); </script> </head> <body> Показать локальные данные <br> </body> </html>3. Отображение данных JSONP Cross-Domain
<%@ page language = "java" import = "java.util.*" pageencoding = "utf-8"%> <! Doctype html public "-// w3c // dtd html 4.01 transitional // en"> <html> <Head> <tite> my jsp 'index.jsp' starmet </title> </title releele releeet letles letles letles> " type = "text/css" href = "./ extjs4.1/resources/css/ext-all.css"> <script type = "text/javascript" src = "./ extjs4.1/ext-debug.js"> </script> <script type = "javascript" src = "./ extjs4.1/locale/ext-lang-Zh_cn.js"> </script> <script type = "text/javascript"> ext.onread (function () {// model Var jsonpmodel = ext.define ("jsonpmodel", {extend: 'ext.data.model', jsonpmodel ", {extend: 'ext.data.model', ' Тип: 'String'}, {name: 'username', type: 'string'}, {name: 'dateline', type: 'string'}, {name: 'title', type: 'string'}]}); Page Proxy: {type: 'jsonp', url: 'http://www.sencha.com/forum/topics-browse-remote.php', reader: {totalproperty: 'totalCount', root: 'темы'}}, AutoLoad: true // автоматически загружать данные}); // Таблица var mygrid = new ext.grid.panel ({columns: [{xtype: 'rownumberer', text: 'line №'}, {text: 'userid', dataindex: 'userid'}, {text: 'username', dataindex: 'usernam «title», DataInDex: 'Title'}], Store: MyShore, BBAR: {// Настройка пейджинг внизу таблицы xtype: 'pagingtoolbar', store: mystore, displayinfo: true}}); // window var window = ext.create ("ext.window.window", {title: 'таблица класса учеников', ширина: 600, высота: 400, пункты: mygrid, макет: 'fit'}); window.show (); }); </script> </head> <body> отображать кросс-домен данных JSONP <br> </body> </html>