合并列-从查找中使用JSON? [英] Combining Columns - From Lookup, Use JSON?

查看:73
本文介绍了合并列-从查找中使用JSON?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一列称为工作名称",该列是从另一个列表中查找的.从查找中,我还带出了另外2列与该工作名称选择相关的数据列.在这个新列表中,我想将所选的工作名称加上另外两个 列.

I have a column called Job Name, which is a lookup from another list.  From the lookup I also bring over 2 other columns of data tied to that Job name selection.  In this new list I would like to combine the selected Job Name plus the two other columns.  What is the proper way to accomplish this.

推荐答案

在计算列论坛中不支持查找字段,您可以尝试创建CSR以自定义显示查找字段.

示例代码:

itemCtx.Templates = {};

itemCtx.Templates.Fields = {    
    'Market': {
        'View': MarketNoLink
    }
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(itemCtx);

function MarketNoLink(ctx) {
   var market = ctx.CurrentItem.Market[0].lookupValue;
   var city = ctx.CurrentItem.Market_x003a_Office_x0020_City;
   var state = ctx.CurrentItem.Market_x003a_State_x0020_UI;

   console.log(market);

   var newMarket = "<span class='text-capitalize'>tttt" + market.toLowerCase() + "</span>";
   newMarket = newMarket + "<div>cccc" + city + ", " + state + "</div>";
   //"<span class='custWidthField'>"+item.Market[0].lookupValue+"</span>";

   return newMarket;
}

这里是供您参考的线程.

最好的问候,

Lee


这篇关于合并列-从查找中使用JSON?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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