0
votes

I have an extjs grid which shows data from a store. The last column is always empty except for the entry in store where, a flag is_deleted=0(Only one entry will have is_deleted=0). I have to show a combobox for this entry with values edit and delete.

The current grid code I have is as follows:

Ext.define('TasoDesktop.view.taso.popups.accountComments.AccountCommentsGrid', {
extend: 'Ext.grid.GridPanel',
alias: 'widget.tasoAccountCommentsGrid',

title: 'Previous Comments',

initComponent: function () {
    this.store = 'AccountLevelComments';

    this.columns = [
        { header: 'Date Entered', dataIndex: 'modified_dt', flex: 0},
        { header: 'Comment', dataIndex: 'c_comment', flex: 0 },
        { header: 'Entered by', dataIndex: 'sid', flex: 0 },
        { header: 'Expiry Date', dataIndex: 'valid_until_dt', flex: 0 },
        { header: 'Action', flex: 0 }
    ];

    this.height = 400;
    this.width = 900;

    this.viewConfig = {
        stripeRows: true
    };

    this.autoScroll = true;

    this.callParent(arguments);
}
});

Only one of the Action column( with is_deleted = 0 in the store) should have the combo-box. How should I include the combobox for it based on the store value?

2

2 Answers

2
votes

Any column editor is defined per-column so you cannot define an editor for column-and-row. What you can do is to conditionally disable the editing for rows that do not match your criteria.

For that, listen to beforeedit event and return false from the listener is the criteria do not match.

0
votes

Add xtype : 'checkcolumn' for the column having header as Action and assign the dataindex property for that column with value ,you need to assign from the store.