欢迎访问中国最大的EXTJS讨论社区 首页 论坛 教程

Ext教程-一起Ext

当前位置: 首页 > 教程 > Ext Grid >

Ext.grid.EditorGridPanel 后台数据传递实例 Ext教程

时间:2009-04-01 14:41来源: 作者: 点击:
上代码: html 页面 html head title测试数据/title meta http-equiv=keywords content=keyword1,keyword2,keyword3 meta http-equiv=description content=this is my page meta http-equiv=content-type content=text/html; charset=UTF-8 link rel

  

上代码:

html 页面

<html>
  <head>
    <title>测试数据</title>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="../../share/ext2.0.2/resources/css/ext-all.css"/>
    <script type="text/javascript" src="../../share/ext2.0.2/adapter/yui/yui-utilities.js"></script>
    <script type="text/javascript" src="../../share/ext2.0.2/adapter/yui/ext-yui-adapter.js"></script>
    <script type="text/javascript" src="../../share/ext2.0.2/ext-all-debug.js"></script>
  </head>

  <body class="body" oncontextmenu="self.event.returnValue=false" scroll="no">
   
      <table width="100%" border="0" valign=top>
        <tr>
          <td width="70%">&nbsp;</td>
          <td><div id="bt_GetCard"></div></td>
          <td><div id="bt_Save"></div></td>
          <td><div id="bt_Cancel"></div></td>
        </tr>
      </table>
<table width="500" border="0" align="center">
<tr><td><div id="test_grid"></div></td></tr>
</table>
</body>

<script type="text/javascript">

Ext.grid.dummyData = [
    {Ids: 1, description: \'\', rate: 0},
    {Ids: 2, description: \'\', rate: 0},
    {Ids: 3, description: \'\', rate: 0},
    {Ids: 4, description: \'\', rate: 0},
    {Ids: 5, description: \'\', rate: 0}
];

Ext.onReady(function(){

Ext.QuickTips.init();

    var xg = Ext.grid;

    var reader = new Ext.data.JsonReader({
        fields: [
            {name: \'Ids\', type: \'int\'},
            {name: \'description\', type: \'string\'},
            {name: \'rate\', type: \'float\'}
        ]

    });

    var dataset = new Ext.data.Store({
        reader: reader,
        data: xg.dummyData
    });

    var grid = new xg.EditorGridPanel({

        ds: dataset,
        columns: [
            {
                header: \'序  号\',
                width: 50,
                dataIndex: \'Ids\'
            },{
                header: "描  述",
                width: 300,
                dataIndex: \'description\',
                hideable: false,
                editor: new Ext.form.TextField({
                   allowBlank: false
                })

声明:本站教程文章版权为一起Ext(http://www.17ext.com/)所有,转载请注明出处
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
最新评论 查看所有评论
发表评论 查看所有评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 密码: 验证码:
推荐内容