Skip to content

Commit

Permalink
[#108471394]
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiel86 committed Jul 1, 2019
1 parent ad3f69d commit 8723215
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/assets/javascripts/global.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ $ ->
### Add "exclude_in_export" class to columns you want excluded from export and then pass in table ID ###
window.exclude_from_export = (table_id) ->
excluded_cols = []
$('.exclude_in_export').each ->
$('#'+table_id + ' .exclude_in_export').each ->
excluded_cols.push $(this).closest('th').index()

if excluded_cols.length
$('#'+table_id).data('export-options').ignoreColumn = excluded_cols
2 changes: 1 addition & 1 deletion app/assets/javascripts/study_level_activities.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ $ ->
$('#study_level_activities li').find("[data-field='notes']").closest('li').hide()
$('#study_level_activities li').find("[data-field='components_export']").closest('li').hide()


### In Study Level Activities we want to ignore data-field: fulfillments_button, components, options ###
exclude_from_export('study-level-activities-table')
exclude_from_export('fulfillments-table')
3 changes: 3 additions & 0 deletions app/views/fulfillments/index.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ $("#modal_area").html("<%= escape_javascript(render(:partial =>'study_level_acti
$("#fulfillments-table").bootstrapTable()
$("#modal_place").modal(backdrop: 'static', keyboard: false)
$("#modal_place").modal 'show'
$('.fulfillments-list li').find("[data-field='docs']").closest('li').hide()
$('.fulfillments-list li').find("[data-field='notes']").closest('li').hide()
exclude_from_export('fulfillments-table')
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
.modal-body
.bootstrap-table-dropdown-overflow
#fulfillment-custom-toolbar
%table.fulfillments{id: "fulfillments-table", data: {toggle: 'table', search: "true", "show-columns" => "true", "show-refresh" => "true", "show-toggle" => "true", url: fulfillments_path(format: :json, line_item_id: line_item.id), striped: "true", toolbar: "#fulfillment-custom-toolbar", "show-export" => "true", "export-types" => ['xlsx'], "export-options" => '{"ignoreColumn": []}'}}
%table.fulfillments{id: "fulfillments-table", data: {toggle: 'table', search: "true", "show-columns" => "true", "show-refresh" => "true", "show-toggleOn" => "true", url: fulfillments_path(format: :json, line_item_id: line_item.id), striped: "true", toolbar: "#fulfillment-custom-toolbar", "show-export" => "true", "export-types" => ['xlsx'], "export-options" => '{"ignoreColumn": []}'}}
%thead.secondary-header
%tr
%th{data: {class: 'fulfillment_grouper', align: "left", sortable: 'true', sorter: 'dateSorter', field: "fulfillment_grouper"}}
Expand Down

0 comments on commit 8723215

Please sign in to comment.