Do not apply column width changes on not table_id tables.
This commit is contained in:
parent
8a045651ce
commit
cd92cdbca7
2 changed files with 7 additions and 7 deletions
|
@ -281,7 +281,8 @@ class App.ControllerTable extends App.Controller
|
|||
@objects = @objects.concat groupObjects[group]
|
||||
groupObjects[group] = [] # release old array
|
||||
|
||||
@calculateHeaderWidths()
|
||||
if @table_id
|
||||
@calculateHeaderWidths()
|
||||
|
||||
# get content
|
||||
table = App.view('generic/table')(
|
||||
|
@ -406,8 +407,7 @@ class App.ControllerTable extends App.Controller
|
|||
container: @container
|
||||
|
||||
calculateHeaderWidths: ->
|
||||
if !@headers
|
||||
return
|
||||
return if !@headers
|
||||
|
||||
if @availableWidth is 0
|
||||
@availableWidth = @minTableWidth
|
||||
|
@ -448,7 +448,7 @@ class App.ControllerTable extends App.Controller
|
|||
if @dndCallback
|
||||
widths += @sortableColWidth
|
||||
|
||||
return widths
|
||||
widths
|
||||
|
||||
setHeaderWidths: =>
|
||||
@calculateHeaderWidths()
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<% groupLast = '' %>
|
||||
<% for object in @objects: %>
|
||||
<% if @groupBy: %>
|
||||
<% groupByName = @P( object, @groupBy, @attributes ) %>
|
||||
<% groupByName = @P(object, @groupBy, @attributes) %>
|
||||
<% if groupLast isnt groupByName: %>
|
||||
<tr class=""><td colspan="<%= length %>"><b><%= groupByName %></b></td></tr>
|
||||
<% groupLast = groupByName %>
|
||||
|
@ -74,7 +74,7 @@
|
|||
</td>
|
||||
<% end %>
|
||||
<% for item in @header: %>
|
||||
<% value = @P( object, item.name, @attributes ) %>
|
||||
<% value = @P(object, item.name, @attributes) %>
|
||||
<% if @callbacks: %>
|
||||
<% if item.name.substr(item.name.length-3, item.name.length) is '_id' && object[ item.name.substr(0, item.name.length-3) ]: %>
|
||||
<% refObject = object[ item.name.substr(0, item.name.length-3) ] %>
|
||||
|
@ -82,7 +82,7 @@
|
|||
<% for attribute, callbacksAll of @callbacks: %>
|
||||
<% if attribute is item.name: %>
|
||||
<% for callback in callbacksAll: %>
|
||||
<% value = callback( value, object, item, @header, refObject ) %>
|
||||
<% value = callback(value, object, item, @header, refObject) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in a new issue