列表显示外键

This commit is contained in:
Jack Zhuang 2017-12-14 14:44:20 +08:00
parent 369700cfac
commit 86a87be017
2 changed files with 2 additions and 3 deletions

View File

@ -19,7 +19,7 @@ Creator.Objects.contacts =
reference_to: "customers"
list_views:
default:
columns: ["name", "description", "modified"]
columns: ["name", "customer_id", "modified"]
permissions:
default:
allowCreate: true

View File

@ -64,11 +64,10 @@ Meteor.startup ->
_.each obj.fields, (field, field_name)->
if field.type == "master_detail" and field.reference_to
tabular_name = field.reference_to + "_related_" + object_name
console.log tabular_name
Creator.TabularTables[tabular_name] = new Tabular.Table
name: tabular_name,
collection: Creator.Collections[object_name],
columns: Creator.getTabularColumns(object_name, ["name"])
columns: Creator.getTabularColumns(object_name, obj.list_views.default.columns)
dom: "tp"
extraFields: ["_id"]
lengthChange: false