Remove group by attribute from header.
This commit is contained in:
parent
4aa4c84477
commit
4bb3ab8a46
1 changed files with 15 additions and 20 deletions
|
@ -134,23 +134,26 @@ class App.ControllerTable extends App.Controller
|
||||||
headerFound = false
|
headerFound = false
|
||||||
for attributeName, attribute of attributes
|
for attributeName, attribute of attributes
|
||||||
|
|
||||||
if !attribute.style
|
# remove group by attribute from header
|
||||||
attribute.style = {}
|
if !@groupBy || @groupBy isnt item
|
||||||
|
|
||||||
if attributeName is item
|
if !attribute.style
|
||||||
# e.g. column: owner
|
attribute.style = {}
|
||||||
headerFound = true
|
|
||||||
if @headerWidth[attribute.name]
|
if attributeName is item
|
||||||
attribute.width = "#{@headerWidth[attribute.name]}px"
|
# e.g. column: owner
|
||||||
headers.push attribute
|
|
||||||
else
|
|
||||||
# e.g. column: owner_id
|
|
||||||
rowWithoutId = item + '_id'
|
|
||||||
if attributeName is rowWithoutId
|
|
||||||
headerFound = true
|
headerFound = true
|
||||||
if @headerWidth[attribute.name]
|
if @headerWidth[attribute.name]
|
||||||
attribute.width = "#{@headerWidth[attribute.name]}px"
|
attribute.width = "#{@headerWidth[attribute.name]}px"
|
||||||
headers.push attribute
|
headers.push attribute
|
||||||
|
else
|
||||||
|
# e.g. column: owner_id
|
||||||
|
rowWithoutId = item + '_id'
|
||||||
|
if attributeName is rowWithoutId
|
||||||
|
headerFound = true
|
||||||
|
if @headerWidth[attribute.name]
|
||||||
|
attribute.width = "#{@headerWidth[attribute.name]}px"
|
||||||
|
headers.push attribute
|
||||||
|
|
||||||
if @orderDirection && @orderBy
|
if @orderDirection && @orderBy
|
||||||
for header in headers
|
for header in headers
|
||||||
|
@ -188,14 +191,6 @@ class App.ControllerTable extends App.Controller
|
||||||
# group by
|
# group by
|
||||||
if @groupBy
|
if @groupBy
|
||||||
|
|
||||||
# remove group by attribute from header
|
|
||||||
overview = _.filter(
|
|
||||||
overview
|
|
||||||
(item) =>
|
|
||||||
return item if item isnt @groupBy
|
|
||||||
return
|
|
||||||
)
|
|
||||||
|
|
||||||
# get new order
|
# get new order
|
||||||
groupObjects = _.groupBy(
|
groupObjects = _.groupBy(
|
||||||
@objects
|
@objects
|
||||||
|
|
Loading…
Reference in a new issue