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
        });
  • 相关阅读:
    achivemq(消息队列)的使用
    java高并发当时处理的思路
    字符串的应用
    正则表达式
    文本文件的读取与写入
    继承
    冒泡排序法
    类与对象
    数据类型
    关键字和语句
  • 原文地址:https://www.cnblogs.com/BobXie85/p/7468334.html
Copyright © 2011-2022 走看看