1. Montrez la table
http://img.blog.csdn.net/20140622133941015?watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvy Wrhbv93enm = / font / 5a6l5l2t / fontsize / 400 / fill / i0jbqkfcma == / dissolver / 70 / Gravity / Southeast <% @ Page Language = "Java" Import = "Java.util. *" Pageencoding = "UTF-8"%> <! DocType Html Public "- // W3C // DTD HTML 4.01 Transitional // En"> <html> <read> <Titre> My JSP 'index.jsp' Page de départ </ Title> <lin href = "./ extjs4.1 / ressources / css / ext-all.css"> <script type = "text / javascript" src = "./ extjs4.1 / ext-all-debug.js"> </ script> <script type = "text / javascrip type = "text / javascript"> ext.onready (function () {// définir la table var grid = new ext.grid.panel ({colonnes: [{text: 'numéro de ligne'}, {text: 'numéro d'étudiant'}, {text: 'name'}, {text: 'class'}, {text: 'chinois'},}, {text: 'class'}, {text: 'chinois'},}, {text: 'Class'}, {text: 'chinois'},}, {text: '}, {Text:' Chine 'English'}]}); // Afficher la fenêtre Window.show (); }); </cript> </ head> <body> Afficher la table <br> </ body> </html>2. Afficher les données locales
<% @ 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 / ressources / 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 / javascrip }, {name: 'étourdissement', type: 'string'}, {name: 'Stuclass', type: 'string'}, {name: 'chscore', type: 'nombre'}, {name: 'mascore', type: 'nombre'}, {name: 'encore', 'nombre'); Data var mydata = [['no1', 'wangzs1', 'grade 1', 80, 67, 49], ['no2', 'wangzs2', 'grade 2', 65, 57, 79], ['no3', 'wangzs3', 'grade 3', ', «grade 4, 59], [« no4 » 19], [«NO5», «Wangzs5», «Grade 5», 23, 97, 99], [«No6», «Wangzs6», «Grade 6», 34, 67, 99],]; var mystore = ext.create ("ext.data.store", {modèle: 'StudentInfo', data: mydata}); // table var mygrid = new ext.grid.panel ({colonnes: [{xType: 'Rownumberrer', texte: 'numéro de ligne'}, {text: 's8 'Chinois', dataindex: 'chscore'}, {text: 'mathématiques', dataindex: 'mascore'}, {text: 'anglais', dataindex: 'encore'}], store: mystore}); // Window var Window = ext.create ("ext.window.window", {Title: 'Student Grade Table', largeur: 600, hauteur: 400, éléments: mygrid, disposition: 'fit'}); window.show (); }); </cript> </ head> <body> Afficher les données locales <br> </body> </html>3. Afficher les données JSONP à domaine croisé
<% @ 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 / ressources / 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 () {// Modèle de données personnalisé var jsonpmodel = ext.define ("jsonpModel", {extension: 'ext.data. 'String'}, {name: 'username', type: 'string'}, {name: 'dateline', type: 'string'}, {name: 'title', type: 'string'}]}); Proxy: {type: 'JSONP', URL: 'http://www.sencha.com/forum/topics-browse-remote.php', lecteur: {TotalProperty: 'TotalCount', root: 'Topics'}}, AutoLoad: true // charge automatiquement des données}); // table var mygrid = new ext.grid.panel ({colonnes: [{xtype: 'Rownumberrer', text: 'Line Number'}, {text: 'userId', dataaindex: 'userrid'}, {text: 'timeline', dataindex: 'userver', {text: 'timeline' 'title', dataindex: 'title'}], magasin: mystore, bbar: {// configurer la pagination en bas du tableau xType: 'pingtoolbar', store: mystore, displayInfo: true}}); // Window var Window = ext.create ("ext.window.window", {Title: 'Student Grade Table', largeur: 600, hauteur: 400, éléments: mygrid, disposition: 'fit'}); window.show (); }); </cript> </ head> <body> Afficher les données JSONP JSONP à domaine transversal <bry> </html>