Search code examples
extjs3

Enable-Disable cells of single column in Ext.grid.EditorGridPanel


I have EditorGridPanel and I want Enable-disable cell values depending on other column value of same Row and I am using Extjs 3. As I tried to find out a solution on Google there is I found that I can able to use RowEditing plugin. I don't want to use this plugin, so is there another way to do this?

And I want to do this enable and disable when click on Edit button, so I can able to do this on "beforeedit" event. here I am getting issue that how I can able to access one particular cell object and how I can able to enable and disable that cell object. There is method to enable-disable whole column of grid but is there any method which returns that particular cell object and enable-disable this cell object?

Is anyone knows is there any way to do this, please let me know. Thanks.


Solution

  • Updated:

    As I previously considering "beforeedit" event is fire for row but it's fire for each cell which we click. So I get field name first as "var fldname= e.field;" and then I am returning false for matched field to make it disable for Ex: var fldname= e.field;

    onBeforeEdit : function(e) {
    var fldname= e.field;
    if(fldname == "FirstName" || fldname = "LastName"){
    return false;
    }
    

    so it disables "FirstName" and "LastName" columns of grid.