Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

Make header optional (like footer) when initializing Grid #233

Merged
merged 1 commit into from
Aug 14, 2013

Conversation

egeste
Copy link
Contributor

@egeste egeste commented Jun 17, 2013

Additional work required, update pending. Oversights abound!

Edit: Much better - this actually works :3

@wyuenho
Copy link
Contributor

wyuenho commented Jun 18, 2013

Under what circumstances would this change be useful?

@egeste
Copy link
Contributor Author

egeste commented Jun 20, 2013

When I have a bunch of custom cells and my graphics designer says "Can you add another table just like that one with another data set that doesn't have a header?"

@wyuenho
Copy link
Contributor

wyuenho commented Jun 20, 2013

How would you know which column is which field then?

@kriswill
Copy link

I had a similar need, just slightly different. Currently, the Grid assumes the header is in the same table as the Grid. In my case, I needed to place the header in a different table that was in a fixed position, the traditional header lock layout. The default grid render would append the header, so I overrode it not to do that, instead I passed in the header_element as an option, and had it use that when initializing the header, and skipped the appending.

something like: !this.options.header_element && this.$el.append(this.header.el)

@egeste
Copy link
Contributor Author

egeste commented Jun 24, 2013

@wyuenho I have a similar scenario to @kriswill - I need a fixed header (which I intent to achieve with a disparate table), and I also have a second set of data in the same format that needs to be grouped separate from the first set of data. EG:

Object - The Thing
Collection - The Collection of The Things

Collection1 - A subset of The Collection
Collection2 - Another subset of The Collection

Table 1 - Floating header, no data.
Table 2 - Collection 1, no header
Table 3 - Collection 2, no header

From that point I intend to listen to sort events on Table 1 and funnel them into Tables 2 and 3 - allowing them to remain sorted per user preference, and still separate

@wyuenho wyuenho mentioned this pull request Jul 11, 2013
5 tasks
@ghost ghost assigned wyuenho Aug 3, 2013
@wyuenho wyuenho closed this in b332a5e Aug 4, 2013
@wyuenho wyuenho reopened this Aug 4, 2013
@wyuenho wyuenho mentioned this pull request Aug 4, 2013
@wyuenho wyuenho merged commit a870339 into cloudflarearchive:master Aug 14, 2013
@santomegonzalo
Copy link

I couldn't find someone who solve this problem, so I made a plugin who works with backgrid to manage fixed header.

https://github.com/gsantome/backgrid.fixedheader

In my project is working GREAT and it's really easy to implement.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants