Skip to content
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

appendToTable doesn't work correctly in IE9 #75

Closed
jvetyska opened this issue May 22, 2012 · 7 comments
Closed

appendToTable doesn't work correctly in IE9 #75

jvetyska opened this issue May 22, 2012 · 7 comments
Milestone

Comments

@jvetyska
Copy link

The problem:
Chrome and FF work fine. But in IE9, whenever appendToTable runs (ie. sorting), the table comes out messed up - sometimes ghost cells are inserted and the whole row gets shifted. I have seen this on larger tables with around 150 rows and about 20 columns. If the table is small, it seems to work fine.

The problem is with added the entire rowset to the tbody:
table.tBodies[k].appendChild(f);

When done inline, like in previous versions, it works perfectly:
for (j = 0; j < l; j++) {
table.tBodies[k].appendChild(r[pos][j]);
}

No doubt, IE is still the buggiest browser.

@Mottie
Copy link
Owner

Mottie commented May 22, 2012

The latest version of tablesorter doesn't append to the table tody directly any more. It appends to a document fragment, then once all rows have been added back, it adds the rows back to the table. It makes everything much faster. Try the sort event demo (with 1022 rows) in IE to see.

@jvetyska
Copy link
Author

Hi,
I have been debugging the problem, so I have noticed the difference.
And it seems to work fine for the demo and for other smaller tables. But
for some reason, if the table has a lot of data, it is not working right.
I have attached a file that shows the problem. It has more columns and some
more data, but nothing special.

By the way, there is another bug in the latest tablesorter - if there is a
colspan, you'll get javascript error. This error has nothing to do with
this tricky table, you'll get it in the simplest of tables with colspan.

On Tue, May 22, 2012 at 2:45 PM, Rob G <
reply@reply.github.com

wrote:

The latest version of tablesorter doesn't append to the table tody
directly any more. It appends to a document fragment, then once all rows
have been added back, it adds the rows back to the table. It makes
everything much faster. Try the sort event demo (with
1022 rows) in IE to see.


Reply to this email directly or view it on GitHub:
#75 (comment)

@Mottie
Copy link
Owner

Mottie commented May 23, 2012

I'm not seeing an issue with IE9 other than it being very slow. I'm working on improvements to hopefully speed up IE's but I'm starting to wonder if you really do have the latest version of tablesorter....

I've also responded to your other ticket about colspan errors, which I'm not seeing either.

And was there a link to a file you wanted to share?

@Mottie
Copy link
Owner

Mottie commented Jun 21, 2012

Is this still an issue?

@jvetyska
Copy link
Author

Hi Rob, I almost thought that everything is good, but if the table is
larger, it is not good, it is still adding ghost cells which breaks the
table layout.
This is clearly an issue IE has, and it would suck to do a workaround or
slow down performance for all other browsers because of this. And I would
hope that IE10 will not have this issue anymore.

When I put the appendChild inside the loop the problem goes away. I also don't see any performance issue with it so I need to run it that way to support IE9.

@Mottie
Copy link
Owner

Mottie commented Jun 27, 2012

I just ran the sort events demo in IE9 for longer than I cared to do it and I didn't have any issues with the layout...

Honestly, this sounds to me like the table isn't formatted correctly. Are all of the TR's, TD's and TH's closed correctly? Try running the page through the validator service to see if there are any problems.

@Mottie
Copy link
Owner

Mottie commented Sep 27, 2012

Tbodies are now detached before being manipulated. Hopefully, it has fixed any issues that might be occurring in IE. crosses fingers

@Mottie Mottie closed this as completed Sep 27, 2012
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

No branches or pull requests

2 participants