• EXT.GRID JOSN


    [TEST.ASP]

    <html>
    <head>
    <title>CSS Example</title>
     <link rel="stylesheet" type="text/css" href="ext2.1/resources/css/ext-all.css" />
     <script type="text/javascript" src="ext2.1/adapter/ext/ext-base.js"></script>
     <script type="text/javascript" src="ext2.1/ext-all.js"></script>
     <script type="text/javascript" src="js.js"></script>
    <script>
     Ext.onReady(function(){
      
        Ext.QuickTips.init();
        var sm = new Ext.grid.CheckboxSelectionModel();
        var cm = new Ext.grid.ColumnModel([
            new Ext.grid.RowNumberer(),
            sm,
            {header:'bh',dataIndex:'id',sortable:true},
            {header:'mc',dataIndex:'name'},
            {header:'ms',dataIndex:'descn'}
        ]);
       
        //
        var ds = new Ext.data.Store({
            proxy: new Ext.data.HttpProxy({url:'TEST.ASP'}),       
            reader: new Ext.data.JsonReader({
                totalProperty: 'totalProperty',
                root: 'root',
                successProperty :'success'
            }, [
                {name: 'id',mapping:'id',type:'int'},
                {name: 'name',mapping:'name',type:'string'},
                {name: 'descn',mapping:'descn',type:'string'}
            ])
        });

       
        var grid = new Ext.grid.GridPanel({
            el: 'grid3',
            ds: ds,
            sm: sm,
            cm: cm,
            700,
            height:280,
            bbar: new Ext.PagingToolbar({
                pageSize: 10,
                store: ds,
                displayInfo: true,
                displayMsg: '顯示 {0} 條到 {1}條記錄,一共 {2} 條',
                emptyMsg: "沒有記錄"
            })
        });
       
        grid.render();
        ds.load({params:{start:0, limit:10}});
    });

    </script>
    </head>

    <body>
      
     <div id="grid3" style=" 100%;height: 100%"></div>
    </body>
    </html>

    [TEST.ASP]        

    <%
       
        json = "{totalProperty:10,root:["
        for i = 0 TO 10
            json =json& "{id:" & i & ",name:'name" & i & "',descn:'descn" & i & "'}"
            if i <> 10 THEN
                json =json& ","
         end if
           
         NEXT
        json =json&"]}"
        response.write(json)

    %>

  • 相关阅读:
    止步于磁盘空间不足
    添加随机扰动 爬山算法
    递归 启发式
    删除文件
    linux 下载 图片
    CURD特性
    php 写session
    php 写session
    14.5.4 InnoDB File-Per-Table Tablespaces 每个表一个文件
    14.5.4 InnoDB File-Per-Table Tablespaces 每个表一个文件
  • 原文地址:https://www.cnblogs.com/zqmingok/p/1511655.html
Copyright © 2020-2023  润新知