1.テーブルを表示します
http://img.blog.csdn.net/20140622133941015?watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvy wrhbv93enm =/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma ==/溶解/70/gravity/southeast <%@@ページ言語= "java" import = "java.util。*" pageencoding = "utf-8"%> <!doctype html public " - // w3c // dtd html 4.01 transitional // en"> <html> <head> <title> my jsp.jsp 'int </cptip "" ""タイプ/ 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 = "./ <script type = "text/javascript"> ext.onready(function(){// table var grid = new ext.grid.panel({columns:[{text: 'line number'}、{text: 'sudent number'}、{text: 'name'}、{text: 'class'}、{text '}、{text'}、{text '}、 'English'}]}); //ウィンドウウィンドウを表示します。show(); }); </script> </head> <body> show table <br> </body> </html>2。ローカルデータを表示します
<%@ページ言語= "java" import = "java.util。*" pageencoding = "utf-8"%> <!doctype html public " - // w3c // dtd html 4.01 transitional // en"> <html> <head> <title 'index.jsp' relink type = "text/css" href = "./ extjs4.1/resources/css/ext-all.css"> <script type = "text/javascript" src = "./ extjs4.1/ext-all-debug.js"> </script> <script = "text/javascript" " src="./extjs4.1/locale/ext-lang-zh_CN.js"></script> <script type="text/javascript"> Ext.onReady(function() { // Custom data model var myModel = Ext.define("studentInfo", { extend : 'Ext.data.Model', fields : [ { name : 'stuNo', type : 'string' }、{name: 'stuname'、type: 'string'}、{name: 'stuclass'、type: 'string'}、{name: 'chscore'、type: 'number'}、{'mascore'、type: 'number'}、{name: 'enscore'}ローカルデータvar mydata = [['no1'、 'wangzs1'、 'grade 1'、80、67、49]、 'no2'、 'wangzs2'、 'grade 2'、65、57、79]、['no3'、 'wangzs3'、 'grade 3'、45、77、77、59] 27、19]、['no5'、 'wangzs5'、 'grade 5'、23、97、99]、['no6'、 'wangzs6'、 'grade 6'、34、67、99]、]; var mystore = ext.create( "ext.data.store"、{model: 'dustentInfo'、data:mydata}); // table var mygrid = new ext.grid.panel({columns:[xtype: 'rownumberer'、text: 'line number'}、{text: 'stunumber'、dataindex: 'stuno'}、{text: 'name'、dataindex: 'stuname'}、 「中国語」、dataindex: 'chscore'}、{text: 'mathematics'、dataindex: 'mascore'}、{text: 'english'、dataindex: 'enscore'}]、store:mystore}); // window var window = ext.create( "ext.window.window"、{title: 'desute grad table'、width:600、height:400、items:mygrid、layout: 'fit'}); window.show(); }); </script> </head> <body>ローカルデータを表示<br> </body> </html>3.クロスドメインJSONPデータを表示します
<%@ページ言語= "java" import = "java.util。*" pageencoding = "utf-8"%> <!doctype html public " - // w3c // dtd html 4.01 transitional // en"> <html> <head> <title 'index.jsp' relink type = "text/css" href = "./ extjs4.1/resources/css/ext-all.css"> <script type = "text/javascript" src = "./ extjs4.1/ext-all-debug.js"> </script> <script = "text/javascript" " src="./extjs4.1/locale/ext-lang-zh_CN.js"></script> <script type="text/javascript"> Ext.onReady(function() { // Custom data model var jsonpModel = Ext.define("jsonpModel", { extend : 'Ext.data.Model', fields : [ { name : 'userid', type : 'string'}、{name: 'username'、type: 'string'}、{name: 'dateline'、inpy: 'string'}、{name: 'title'、type: 'string'}]})})});プロキシ:{type: 'jsonp'、url: 'http://www.sencha.com/forum/topics-browse-remote.php'、reader:{totalproperty: 'totalcount'、root: 'topics'}}、autoload:true // rue load data}); // table var mygrid = new ext.grid.panel({columns:[xtype: 'rownumberer'、text: 'line number'}、{text: 'userid'、dataindex: 'userid'}、{text: 'username'、dataindex: 'username'}、{text: 'qumeline'、 'qumeline'、 'qumeline'、 'cemeline'} 'title'、dataindex: 'title'}]、store:mystore、bbar:{//テーブルの下部でページングを構成xtype: 'pagingtoolbar'、store:mystore、displayinfo:true}}); // window var window = ext.create( "ext.window.window"、{title: 'desute grad table'、width:600、height:400、items:mygrid、layout: 'fit'}); window.show(); }); </script> </head> <body>クロスドメインjsonpデータ<br> </body> </html>を表示します