Extjs checkcolumn 禁用某些行,基于值 [英] Extjs checkcolumn disable for some rows, based on value

查看:21
本文介绍了Extjs checkcolumn 禁用某些行,基于值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 checkcolumn 的网格.例如,它的 dataIndex 是已检查".

I have a grid, with checkcolumn. It's dataIndex is, for example, 'checked'.

我想禁用或隐藏某些行的复选框,其中另一个值(例如can_be_checked")为假/空.

I want to disable or hide checkboxes for some rows, where another value, 'can_be_checked' for example, is false/empty.

渲染器已经在 checkcolumn 中定义,弄乱它会破坏复选框的生成.

Renderer is already defined in checkcolumn, messing with it breaks generation of checkbox.

我该怎么做?

推荐答案

您可以隐藏渲染器内部的复选框,例如:

You may hide the checkbox just inside the renderer, for example:

column.renderer = function(val, m, rec) {
    if (rec.get('can_be_checked') == 'FALSE'))
        return '';
    else
        return (new Ext.ux.CheckColumn()).renderer(val);
};

这篇关于Extjs checkcolumn 禁用某些行,基于值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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