• ExtJS 使用点滴 六 如何设置EditorGridPannel 中特定行的只读属性


    Ext.onReady(function(){

        Ext.QuickTips.init();
       
        var fm = Ext.form,Ed = Ext.grid.GridEditor;
        var sm = new Ext.grid.CheckboxSelectionModel(); 
        
        var cm = new Ext.grid.ColumnModel({
        columns: [
            {
                header: "Leaf Class",
                   dataIndex: 'partCat',
                    120,
                   align: 'left'
            },{
                   header: "Shown on Drawing ?",
                   dataIndex: 'shownonDrawing',
                    160,
                   align: 'center',

                   editor: new Ed(new Ext.form.ComboBox({
                    typeAhead: true,
                       triggerAction: 'all',
                       transform:'Drwaing',               
                       lazyRender:true
                 }))
            },{
                header: "Drawing Number",
                   dataIndex: 'drawingNumber',
                    160,
                   align: 'center',

                   editor: new fm.TextField({
                    allowBlank: false,
                     allowNegative: false,
                       maxValue: 100000
                 })
             }],
        isCellEditable: function(col, row) {
            var record = ds.getAt(row);
            if (record.get('shownonDrawing') == 'Same As New Part') {
                return false;
            }
            return Ext.grid.ColumnModel.prototype.isCellEditable.call(this, row, col);
        }
        });

        // by default columns are sortable
        cm.defaultSortable = true;
        
        var Plant = Ext.data.Record.create([
              {name: 'partCat'},
              {name: 'shownonDrawing'},
              {name: 'drawingNumber'}
          ]);

        // create the Data Store
        var ds = new Ext.data.Store({
            url: 'PartAttributes.xml',
            reader: new Ext.data.XmlReader({
                   record: 'partattrDesc'
            }, Plant),

            sortInfo:{field:'nounname', direction:'ASC'}
        });

        // create the editor grid
        var griPI = new Ext.grid.EditorGridPanel({
            ds: ds,
            cm: cm,
            sm: sm,
            renderTo: 'partAttributes',
            800,
            height:400,
            frame:true,
            clicksToEdit:1,
            tbar: [{
                text: ' Save as Draft  ',
                iconCls: 'Save as Draft',
                id: 'Save as Draft',
                handler: function(){
                }
            },'-',{
                text: ' Next  ',
                iconCls: 'Next',
                id: 'Next',
                handler: function(){
            window.open("some.jsp","_self")
                }
            },'-',{
                text: ' Cancel  ',
                iconCls: 'Cancel',
                id: 'Cancel'
            }
            ]
        });

        // trigger the data store load
        ds.load();
    });
  • 相关阅读:
    Java入门 第二季第三章 继承
    湖南长沙IOS(xcode swift) 开发交流群
    C++对象模型——"无继承"情况下的对象构造(第五章)
    算术与逻辑运算指令具体解释
    linux中man手冊的高级使用方法
    Swift 数组
    webservice Connection timed out
    创建SharePoint 2010 Timer Job
    指向函数的指针数组的使用方法
    修改Tomcat Connector运行模式,优化Tomcat运行性能
  • 原文地址:https://www.cnblogs.com/FredTang/p/2687017.html
Copyright © 2020-2023  润新知