ExtJS Data Grid Column渲染器具有多个值 [英] ExtJS Data Grid Column renderer to have multiple values

查看:102
本文介绍了ExtJS Data Grid Column渲染器具有多个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道ExtJS中是否有可能对列的渲染器提供数据源的几个值。例如,使用操作列,将id传递给渲染器。然而,我需要传递给渲染的user_id和id。我该怎么做?

I am wondering if it is possible in ExtJS to have several values of the data source available to the renderer of the column. For example with the "Actions" column, the id is passed to the renderer. However I require both the user_id and id passed to the render. How may I do this?

table_cols = [{
    header: "User ID",
    width: 30,
    sortable: true,
    dataIndex: 'user_id'
},
{
        header: "Actions",
        width: 60,
        sortable: false,
        dataIndex: 'id',
        renderer: function(val) {
               //IF USER ID MEETS A CONSTRAINT PRINT THE ID
         }
}];

谢谢。

推荐答案

据我所知,渲染器函数有几个参数:

As far as I know renderer function has several parameters:

     renderer: function(val, meta, record) {
           var userId = record.data.user_id;
     }

您可以查看 docs 的所有参数

这篇关于ExtJS Data Grid Column渲染器具有多个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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