首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

根本表格GridPanel

2012-11-23 
基本表格GridPanel%@ page languagejava contentTypetext/html charsetutf-8 pageEncodingutf-

基本表格GridPanel
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<html>
<head>
   <title></title>
   <meta http-equiv="content-type" content="text/html; charset=UTF-8">
   <script type="text/javascript" src="/test/extjs/adapter/ext/ext-base.js"></script>
   <script type="text/javascript" src="/test/extjs/ext-all.js"></script>
   <script type="text/javascript" src="/test/extjs/ext-all-debug.js"></script>
   <link rel="stylesheet" type="text/css" href="/test/extjs/resources/css/ext-all.css">
   <script type="text/javascript">
     function showUrl(value){
        return '<a href="http://'+value+'">'+value+'</a>';
     }
    
      Ext.onReady(function(){
        var data = [
          [1,'EasyJWeb','EasyJF','www.easyjf.com'],
          [2,'jfox','huihoo','www.huihoo.org'],
          [3,'jdon','jdon','www.jdon.com'],
          [4,'springside','springside','www.springside.org.cn']
       ];
       var store = new Ext.data.SimpleStore({
         data:data,
         fields:["id","name","organization","homepage"]
       });
       var colM = new Ext.grid.ColumnModel([
           {header:"项目名称:",dataIndex:"name",sortable:true},
           {header:"开发团队",dataIndex:"organization",sortable:true},
           {header:"网址",dataIndex:"homepage",renderer:showUrl}
       ]);
      
      var grid = new Ext.grid.GridPanel({
         renderTo:"hello",
         title:"中国Java开源产品及团队",
         height:150,
         width:600,
         cm:colM,
         store:store,
         autoExpandColumn:2
       });
      });
    </script>
</head>
<body>
     <div id="hello" style="margin-left:50px; margin-top:10px; align:center;"></div>
</body>
</html>

热点排行