Skip to content

Update: If a table footer is present add the "column-index" data attr… #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

Dgc2002
Copy link

@Dgc2002 Dgc2002 commented Feb 28, 2016

…ibute for use in other plugins

@Dgc2002
Copy link
Author

Dgc2002 commented Feb 28, 2016

While working with the ColResize plugin I ran into an issue where I was having to do some pretty hacky things to enable column resizing using the table footer as well as header. ColResize takes advantage of the fact that ColReorder adds the column-index data attribute to header cells. This PR simply extends that functionality to table footer elements as well.

Here's an example of how it currently behaves. You are able to resize a column using the table header but not the footer. Demo

Here is an example of the result of this PR. You are able to resize the column using both header and footer elements: Demo

I've only made a hand full of pull requests to established repos. Let me know if I'm missing anything.

Edit: And that's when I realized my IDE auto formatted some so it doesn't conform to the the project's current style. Fixing.

@Dgc2002
Copy link
Author

Dgc2002 commented Feb 28, 2016

Sometimes using Git is like herding cats. That got messy, I can resubmit a straight pull request if you'd like.

@DataTables
Copy link
Collaborator

Thanks for the PR. I see the issue that this resolves, however, DataTables allows the footer elements to be a bit more flexible than the header in that a cell can colspan multiple columns.

I'm not sure how that should be handled here (multiples column indexes for a cell, or skip indexes?). This probably needs some thought "up stream" in DataTables about how to handle this.

@Dgc2002
Copy link
Author

Dgc2002 commented Mar 2, 2016

Ahh I see, I wasn't aware of that.

I think skipping indexes might obscure the meaning of the property.

For my immediate application I could see something like a column-index-start-X and column-index-end-X working. I was thinking column-index-range-X-Y but that's starting to get a bit wordy.

I'll just pull this functionality into ColResize for the time being.

@AllanJard
Copy link
Contributor

ColReorder 2 is a total rewrite and is a lot cleaner in how it moves the columns around. Going to close as this PR is old (my fault - sorry).

@AllanJard AllanJard closed this Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants