zoukankan      html  css  js  c++  java
  • DOJO-dojox.grid.EnhancedGrid(带刷新函数,分页工具栏,复选框,行号等功能)

    转自:http://biancheng.dnbcw.info/javascript/395865.html

    dojo.require("dojox.grid.EnhancedGrid");
    dojo.require("dojox.grid.enhanced.plugins.Pagination");
    dojo.require("dojox.grid.cells");
    dojo.require("dojox/grid/_CheckBoxSelector");
    dojo.require("dojo.data.ItemFileWriteStore");


    var grid = new dojox.grid.EnhancedGrid({

        jsid: "grid",
        style: '300px',
        refresh: function(){
            var oThis = this;
            oThis.setStore(new dojo.data.ItemFileWriteStore({
                url: '这里写上你的请求地址ACTION,servlet,json文件等',
                handleAs: "json"
            }));
        },
        structure: [{
            type : "dojox.grid._CheckBoxSelector",
            width : 3
        },[    
            new dojox.grid.cells.RowIndex({ 2, name:''}),
            {name: '列1, field: 'col1'},
            {name: '列2', field: 'col2'}
        ]],
        columnReordering: true,
        rowsPerPage: "20",
        plugins: {
          pagination: {
              //pageSizes: seit.gx.pageSize4Grid,
              pageSizes: [],
              description: true,
              sizeSwitch: true,
              pageStepper: true,
              gotoButton: true,
              maxPageStep: 4,
              position: "bottom"
          }
        },
        'onCellClick': function(e){
            alert(e.rowIndex);
        },

    });

    grid.refresh();

    grid.set("onCellClick", function(e){//点击事件
        var item = grid.getItem(e.rowIndex);
            store = grid.store,
            name = store.getValue(item, "id"),
            datasourceCell= 3,//数据源
            collectCell= 4,//采集
            ri = e.rowIndex,//点击的行号
            ci = e.cellIndex,//点击的列号

            item = grid.getItem(ri);

    });

  • 相关阅读:
    Python 文件Hash(MD5,SHA1)
    CDHtmlDialog探索Javascript与窗体交互
    C++ 实现不允许继承的类
    (一)JDBC入门及简介
    (二)JDBC 连接数据库
    2012年,总结
    canvas 时钟
    解决数据库日志文件过满的又一方法
    Windows XP 注册表修改大全
    windows2003中安装.netframework1.1
  • 原文地址:https://www.cnblogs.com/honglihome/p/3467886.html
Copyright © 2011-2022 走看看