1. #1
    Sencha User
    Join Date
    Feb 2008
    Posts
    107
    Vote Rating
    0
    JDevloper is on a distinguished road

      0  

    Default Need to readonly the column of Ext.grid.PropertyGrid

    Need to readonly the column of Ext.grid.PropertyGrid


    Hi,

    I am using Ext.grid.PropertyGrid but when i am using this it servers value as editable column,

    but i dont need it as editable column just readonly.i searched the doc i don't find any config

    option to make this column readonly. can anyone give a suggestion?

    Thanks in advance.

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Return false to http://extjs.com/deploy/dev/docs/?cl...ber=beforeedit ?

    Or configure it with

    Code:
    startEditing: Ext.emptyFn,
    ?

  3. #3
    Sencha User
    Join Date
    Feb 2008
    Posts
    107
    Vote Rating
    0
    JDevloper is on a distinguished road

      0  

    Default


    Thanks animal i got it ,also i have an another requirement to change the label of the
    column header (Name and Value pair) in the grid,is there a way to change this column header?.


    Thanks in advance

  4. #4

  5. #5
    Sencha User
    Join Date
    Feb 2008
    Posts
    107
    Vote Rating
    0
    JDevloper is on a distinguished road

      0  

    Default


    Hi ,

    I am using setSource config option for my prop grid ,am not using column model,so how can i

    change the column header(default name/value) into my custom columnname and value

    headers

    Thanks,

  6. #6
    Ext User
    Join Date
    Apr 2008
    Posts
    26
    Vote Rating
    0
    niaz is on a distinguished road

      0  

    Default


    Hi JDevloper,

    I am using the following extended property grid to set column headers and have a readyonly grid.

    Code:
    Ext.ns('Ext.ux.grid');
    Ext.ux.grid.ReadOnlyPropertyGrid = Ext.extend(Ext.grid.PropertyGrid, {
        //private 
        initComponent: function(){        
            //override if set
            if (!Ext.isEmpty(this.nameText)) {
                Ext.override(Ext.grid.PropertyColumnModel, {
                    nameText: this.nameText
                });
            }
            
            if (!Ext.isEmpty(this.valueText)) {
                Ext.override(Ext.grid.PropertyColumnModel, {
                    valueText: this.valueText
                });
            }
                    
            //make the grid readonly
            this.on({
                beforeedit: function(){
                    return false;
                },
                scope: this
            });
        }
    });
    I hope this helps

  7. #7
    Sencha User
    Join Date
    Oct 2012
    Location
    Delhi
    Posts
    2
    Vote Rating
    0
    pdubey is on a distinguished road

      0  

    Default just use "beforeedit" event like this, it will make valuecolumn readonly

    just use "beforeedit" event like this, it will make valuecolumn readonly


    listeners : {
    beforeedit : function(e) {
    return false;
    }
    }

Thread Participants: 3