mirror of
https://github.com/steedos/steedos-platform
synced 2024-11-23 09:26:24 +00:00
删除函数 getObjectField
This commit is contained in:
parent
5e02b51cd6
commit
82fc8755a6
@ -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")
|
||||
|
@ -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 =
|
||||
|
Loading…
Reference in New Issue
Block a user