Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在extjs网格中仅为一行添加combobox_Javascript_Extjs_Combobox_Extjs4_Extjs4.1 - Fatal编程技术网

Javascript 在extjs网格中仅为一行添加combobox

Javascript 在extjs网格中仅为一行添加combobox,javascript,extjs,combobox,extjs4,extjs4.1,Javascript,Extjs,Combobox,Extjs4,Extjs4.1,我有一个extjs网格,它显示来自存储的数据。最后一列总是空的,除了存储中的条目,其中有一个标志is_deleted=0(只有一个条目的is_deleted=0)。我必须为这个条目显示一个组合框,其中包含值edit和delete 我目前拥有的电网代码如下: Ext.define('TasoDesktop.view.taso.popups.accountComments.AccountCommentsGrid', { extend: 'Ext.grid.GridPanel', alias: 'wi

我有一个extjs网格,它显示来自存储的数据。最后一列总是空的,除了存储中的条目,其中有一个标志
is_deleted=0
(只有一个条目的is_deleted=0)。我必须为这个条目显示一个组合框,其中包含值edit和delete

我目前拥有的电网代码如下:

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);
}
});

只有一个操作列(存储中的is_deleted=0)应该有组合框。如何根据存储值为其包含组合框?

任何列编辑器都是按列定义的,因此不能为列和行定义编辑器。您可以做的是有条件地禁用对不符合条件的行的编辑


为此,如果条件不匹配,请侦听并从侦听器返回false。

添加xtype:“checkcolumn”对于标题为Action的列,并使用值为该列分配dataindex属性,您需要从存储区分配