Javascript ExtJS 数据网格列渲染器具有多个值
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2592317/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ExtJS Data Grid Column renderer to have multiple values
提问by Podlsk
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?
我想知道是否可以在 ExtJS 中为列的渲染器提供多个数据源值。例如对于“Actions”列,id 被传递给渲染器。但是我需要将 user_id 和 id 传递给渲染。我该怎么做?
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
}
}];
Thanks.
谢谢。

