zoukankan      html  css  js  c++  java
  • Extjs 3 控制Grid某行某列不可编辑

    var cmGoodsFee = new Ext.grid.ColumnModel([rmGoodsFee, {
            header : "id",
            tooltip : "id",
            dataIndex : 'id',
            id : 'id',
            width : 80,
            align : 'center',
            hidden : true
        }, {
            header : "计费类型",
            tooltip : "计费类型",
            dataIndex : 'chargAccName',
            id : 'chargAccCode',
            width : 120,
            sortable : true,
    //      summaryType : 'count',
            hideable : false
            // summaryRenderer : function(v, params,
            // data) {
        // return ((v == 0 || v > 1) ? '( 合计)' :
        // '(合计)');
        // }
    }   , {
            header : "付款方向",
            tooltip : "付款方向",
            dataIndex : 'chargingDirection',
            id : 'chargingDirection',
            width : 120,
            sortable : true
        }, {
            header : "金额",
            tooltip : "金额",
            dataIndex : 'feeAmount',
            id : 'feeAmount',
            width : 150,
            align : 'center',
            sortable : true,
            // summaryType : 'sum',
            editor : new Ext.form.NumberField({
                        style : 'text-align:left',
                        decimalPrecision : 4,
                        allowNegative : false, // 不能为负数
                        maxValue : 999999999,
                        maxText : '最大不超过999,999,999!'
                    })
        }]);
    
    //  var summary = new Ext.ux.grid.GridSummary();
        wayBillsDetailGridFee = new Ext.grid.EditorGridPanel({
        collapsible : false,
        clicksToEdit : 1,
        animCollapse : false,
        stripeRows : true,
        store : wayBillDetailStoreFee,
        cm : cmGoodsFee,
        height : Ext.getBody().getHeight() - 175,
        frame : true,
        loadMask : true,// 载入遮罩动画
        columnLines : true,
        autoShow : false,
        viewConfig : {
            forceFit : false
        },
        clicksToEdit : 1,
        listeners : {
            cellclick : function(grid, rowIndex, columnIndex, e) {
                var record = grid.getStore().getAt(rowIndex);
                if (record.get('chargAccName') == '长途运费' && columnIndex == 4) {
                    return false;
                } else {
                    return true;
                }
            }
        }
            // plugins : summary
        });
  • 相关阅读:
    win7下安装Linux实现双系统全攻略
    Dreamweaver_CS6安装与破解,手把手教程
    windows Server 2008各版本有何区别?
    如何查看路由器中的pppoe拨号密码?
    xp远程桌面连接最大用户数怎么设置?
    网站的盈利模式
    linux 下安装mysql-5.7.16
    GNS3连接虚拟机
    cain使用教程
    数据中心网络架构的问题与演进 — CLOS 网络与 Fat-Tree、Spine-Leaf 架构
  • 原文地址:https://www.cnblogs.com/BobXie85/p/7468334.html
Copyright © 2011-2022 走看看