#499, #555 optionable DMSF columns

This commit is contained in:
Karel Picman 2017-01-10 13:03:47 +01:00
parent 1af0f5a461
commit 23c382190f

View File

@ -15,6 +15,17 @@ $("#browser").dataTable().fnDestroy();
$('#<%= params[:row_id] %>').after('<%= escape_javascript(render(:partial => 'dmsf/dmsf_rows')) %>');
// Reinitialize the dataTable
<% title = DmsfFolder.get_column_position('title') %>
<% position = DmsfFolder.get_column_position('position') %>
<% commands = DmsfFolder.get_column_position('commands') %>
<% position = DmsfFolder.get_column_position('position') %>
<% version = DmsfFolder.get_column_position('version') %>
<% size_calculated = DmsfFolder.get_column_position('size_calculated') %>
<% modified_calculated = DmsfFolder.get_column_position('modified_calculated') %>
<% version_calculated = DmsfFolder.get_column_position('version_calculated') %>
<% size = DmsfFolder.get_column_position('size') %>
<% modified = DmsfFolder.get_column_position('modified') %>
$('#browser').dataTable({
'bJQueryUI': true,
'oLanguage': {
@ -22,14 +33,22 @@ $('#browser').dataTable({
},
'bAutoWidth': false,
'bPaginate': false,
'aaSorting': [[1, 'asc']],
'aaSortingFixed': [[ 8, 'asc']],
<% if title %>
'aaSorting': [[<%= title %>, 'asc']],
<% end %>
'aaSortingFixed': [[ <%= position %>, 'asc']],
'aoColumnDefs': [
{ 'bSearchable': false, 'aTargets': [0, 7, 8, 9, 10, 11] },
{ 'bSortable': false, 'aTargets': [0, 7] },
{ 'iDataSort': 9, 'aTargets': [ 2 ] },
{ 'iDataSort': 10, 'aTargets': [ 3 ] },
{ 'iDataSort': 11, 'aTargets': [ 4 ] }
{ 'bSearchable': false, 'aTargets': [0, <%= commands %>, <%= position %>, <%= size_calculated %>, <%= modified_calculated %>, <%= version_calculated %>] },
{ 'bSortable': false, 'aTargets': [0, <%= commands %>] }
<% if size %>
,{ 'iDataSort': <%= size_calculated %>, 'aTargets': [ <%= size %> ] }
<% end %>
<% if modified %>
,{ 'iDataSort': <%= modified_calculated %>, 'aTargets': [ <%= modified %> ] }
<% end %>
<% if version %>
,{ 'iDataSort': <%= version_calculated %>, 'aTargets': [ <%= version %> ] }
<% end %>
],
'fnInitComplete': function() {
$(dmsfButtons).prependTo($('#browser_wrapper div.fg-toolbar')[0]);