删除函数 getObjectField

This commit is contained in:
Jack Zhuang 2017-12-21 15:28:52 +08:00
parent 5e02b51cd6
commit 82fc8755a6
2 changed files with 3 additions and 20 deletions

View File

@ -133,15 +133,6 @@ Creator.getObjectUrl = (object_name, record_id, app_id) ->
else
return Steedos.absoluteUrl("/app/" + app_id + "/" + object_name + "/list")
Creator.getObjectField = (object_name, field_name)->
obj = Creator.Objects[object_name]
if obj.fields[field_name]
return obj.fields[field_name]
else
return Creator.baseObject.fields[field_name]
Creator.getCollection = (object_name)->
if !object_name
object_name = Session.get("object_name")

View File

@ -1,28 +1,20 @@
Creator.getTabularColumns = (object_name, columns) ->
obj = Creator.getObject(object_name)
cols = []
_.each columns, (field_name)->
field = Creator.getObjectField(object_name, field_name)
field = obj.fields[field_name]
if field?.type
col = {}
col.data = field_name
col.render = (val, type, doc) ->
col.sTitle = '<div class="slds-truncate" title="">' + t("" + object_name + "_" + field_name.replace(/\./g,"_")); + '</div>'
# col.createdCell = (node, cellData, rowData) ->
# $(node).css()
col.className = "slds-cell-edit cellContainer"
col.createdCell = (cell, val, doc) ->
$(cell).attr("data-label", field_name)
Blaze.renderWithData(Template.creator_table_cell, {_id: doc._id, val: val, doc: doc, field: field, field_name: field_name, object_name:object_name}, cell);
# col.tmpl = Meteor.isClient && Template.creator_table_cell
# col.tmplContext = (rowData)->
# return {
# cell: rowData[field_name],
# row: rowData
# field_name: field_name
# }
cols.push(col)
action_col =