在Ag-Grid中,当列定义为可编辑时,如何使浮动行不可编辑? [英] In Ag-Grid, how to make a floating row not editable when column is defined as editable?

查看:245
本文介绍了在Ag-Grid中,当列定义为可编辑时,如何使浮动行不可编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在AG-Grid中,当列定义为可编辑状态时,如何使浮动行不可编辑?

In AG-Grid, How to make a floating row not editable when a column is defined as editable?

是否可以使用floatCellRenderer来防止为

Is it possible to use floatingCellRenderer to prevent cell editing for the floating row cell?

floatingCellRenderer: function(params) {
    if (params.node.floating) {
        do_something_here_to_prevent_this_cell_editing;
    }
}

我正在使用默认的单元格编辑器进行文本/选择

I am using the default cell editors for text/select on the grid.

推荐答案

jsfiddle

您需要做的就是创建一个检查行是否浮空的函数:

all you need to do is make a function that checks whether or not a row is floating:

function notFloating (params){
  return !params.node.floating
}

然后将其传递到受影响列的可编辑属性

then pass that into the editable attribute of the affected column

这篇关于在Ag-Grid中,当列定义为可编辑时,如何使浮动行不可编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆