Extjs 6.5.3从记录值绑定小部件列的隐藏属性 [英] Extjs 6.5.3 Binding hidden property of widgetcolumn from record values

查看:83
本文介绍了Extjs 6.5.3从记录值绑定小部件列的隐藏属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示/隐藏具有记录属性的网格的小部件列.

I want to show/hide widgetcolumn of a grid with a property of my record.

我试图通过绑定我的值来做到这一点:

I tried to do that with binding my value :

{
    xtype: 'grid',
    bind: {
        store: 'ActionList'
    },
    border: true,
    flex: 2,
    name: 'actionList',
    title: this.titleActionGrid,
    columns: [{
        xtype: 'widgetcolumn',
        height: 50,
        width: 65,
        widget: {
            xtype: 'button',
            text: '{sActionTitle}',
            scale: 'large',
            height: 45,
            width: 45,
            margin: 5
        },
        bind: {
            hidden: '{bIsHidden}'
        }
    }]
}

那没有用,所以我在互联网上搜索,发现了这个小提琴: https://fiddle.sencha.com/#view/editor&fiddle/22rl

that didn't work so i search on internet and i find this fiddle : https://fiddle.sencha.com/#view/editor&fiddle/22rl

所以我尝试了这部分代码:

So i tried it with this part of code :

cell: {
    tools: {
        up: {
            bind: {
                hidden: '{record.bIsHidden}'
            }
        }
    }
}

但是那没有用,事实上,小提琴是关于Modern的,而我的代码是关于classic的..

But that didn't work, in fact the fiddle was on Modern and my code on classic..

我什么也没找到,这就是为什么我在这里恳求任何人帮助我;)

I didn't find anything else and this is why i'm here, imploiring anyone to help me ;)

提前谢谢您.

ExtJS Classic 6.5.3

ExtJS Classic 6.5.3

推荐答案

您可以像这样绑定它:

Ext.create('Ext.grid.Panel', {
     renderTo: Ext.getBody(),
     store: store,
     border: true,
     flex: 2,
     name: 'actionList',
     title: this.titleActionGrid,
     columns: [{
             dataIndex: 'id',
         },
         {
             xtype: 'widgetcolumn',
             height: 50,
             width: 165,
             dataIndex: 'hide',
             widget: {
                 bind: {
                     text: '{record.id}',
                     hidden: '{record.hide}'
                 },
                 xtype: 'button',
                 scale: 'large',
                 height: 45,
                 width: 155,
                 margin: 5
             }
         }
     ]
 });

这篇关于Extjs 6.5.3从记录值绑定小部件列的隐藏属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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