如何仅对ag网格中的某些行禁用编辑 [英] how to disable editing for only some rows in ag grid

查看:257
本文介绍了如何仅对ag网格中的某些行禁用编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想根据条件启用ag-grid(例如:2/5)中的某些行。

i want to enable only some rows in my ag-grid(exemple :2/5) based on a condition .

editable:false不能帮助,因为除非有我不知道的方法,否则它将应用于整个列表

editable:false can't help because it is applied on the whole list unless if there is a method I do not know

有任何帮助请

推荐答案

您可以将函数绑定到可编辑属性> columnDef ,将在每次尝试 edit

You can just bind function to editable property in columnDef, which will be executed on each try of edit

editable: this.checkEditFunction.bind(this)
...
checkEditFunction(params){
    //params.node - for row identity
    //params.column - for column identity
    return !params.node.isRowPinned() // - just as sample
}

.bind(this)-仅用于访问外部功能

.bind(this) - just for accessibility of external functions

这篇关于如何仅对ag网格中的某些行禁用编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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