diff --git a/creator/packages/steedos-creator/core.coffee b/creator/packages/steedos-creator/core.coffee index 751a845d29..936184e73c 100644 --- a/creator/packages/steedos-creator/core.coffee +++ b/creator/packages/steedos-creator/core.coffee @@ -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") diff --git a/creator/packages/steedos-creator/lib/listviews.coffee b/creator/packages/steedos-creator/lib/listviews.coffee index 516d4e81d6..fbab0c68bd 100644 --- a/creator/packages/steedos-creator/lib/listviews.coffee +++ b/creator/packages/steedos-creator/lib/listviews.coffee @@ -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 = '
' + t("" + object_name + "_" + field_name.replace(/\./g,"_")); + '
' - # 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 =