别来无恙`` 2016-11-14 07:11 采纳率: 100%
浏览 2582
已采纳

Ext.GridPanel的columns里添加的items如何隐藏?

图片说明
图片说明

Extjs为3.3
如果可以按条件隐藏某一行的那再好不过了,哪位大牛告知一下?

  • 写回答

2条回答 默认 最新

  • Go 旅城通票 2016-11-14 09:58
    关注

    http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.grid.ActionColumn-cfg-items
    配置getClass ,依据传入的此列的值返回一个hidden样式名称隐藏,说是3.4才有,其实3.3也支持。
    CSS

             .hideop{display:none}
    
                  {
                        xtype: 'actioncolumn', header: 'operate', items: [{
                            icon: '1.png', getClass: function (v, meta, r) {
                                if (r.get('price') > 50) return 'hideop';
                                    return ''
                            }
                        }]
                    }
    
     items : Array★
    An Array which may contain multiple icon definitions, each element of which may contain:
    
    icon : String
    The url of an image to display as the clickable element in the column.
    iconCls : String
    A CSS class to apply to the icon image. To determine the class dynamically, configure the item with a getClass function.
    getClass : Function
    A function which returns the CSS class to apply to the icon image. The function is passed the following parameters:
    v : Object
    The value of the column's configured field (if any).
    metadata : Object
    An object in which you may set the following attributes:
    
    css : String
    A CSS class name to add to the cell's TD element.
    attr : String
    An HTML attribute definition string to apply to the data container element within the table cell (e.g. 'style="color:red;"').
    r : Ext.data.Record
    The Record providing the data.
    rowIndex : Number
    The row index..
    colIndex : Number
    The column index.
    store : Ext.data.Store
    The Store which is providing the data Model.
    handler : Function
    A function called when the icon is clicked.
    scope : Scope
    The scope (this reference) in which the handler and getClass functions are executed. Fallback defaults are this Column's configured scope, then this Column.
    tooltip : String
    A tooltip message to be displayed on hover. Ext.QuickTips must have been initialized.
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵