有没有办法隐藏 Keystone.js 中的 ID 列?

Is there a way to hide the ID column in Keystone.js?

我在尝试隐藏由 Keystone 列表模板自动生成的 ID 列时遇到问题。有没有办法抑制这一列? 该文档很少涵盖框架的基本用法。

如果没有 "name" 字段可用于 link 到管理员 UI 中的详细信息视图(或者当名称字段未显示)。

你不能隐藏它,或者更确切地说,我们需要 可以用来附加 link 的东西。但是,您可以使用 map 功能将其替换为任何其他 nametext 字段。

例如,如果您想在模型中使用 key 列作为 "linking" / 标识符 属性:

var MyList = new keystone.List('MyList', {
  map: { name: 'key' }
});

MyList.add({
  key: String // this will be used wherever a "name" is required, instead of the ID
});

它在文档的 List Options 中有所介绍。