ExtJS Data Grid Column renderer to have multiple values

懵懂的女人 提交于 2019-12-21 04:48:26

问题


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
         }
}];

Thanks.


回答1:


As far as I know renderer function has several parameters:

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

You can check the docs for all the parameters



来源:https://stackoverflow.com/questions/2592317/extjs-data-grid-column-renderer-to-have-multiple-values

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!