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

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

问题描述

我想知道是否可以在 ExtJS 中为列的渲染器提供多个数据源值.例如对于Actions"列,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
         }
}];

谢谢.

推荐答案

据我所知renderer函数有几个参数:

As far as I know renderer function has several parameters:

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

你可以查看docs 所有参数

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

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