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

clear column container when refreshing #1145

Merged
merged 1 commit into from
Jan 28, 2016
Merged

clear column container when refreshing #1145

merged 1 commit into from
Jan 28, 2016

Conversation

eltharin
Copy link

when refreshing plugins, i have all columns in double on the columnselector div.

@Mottie
Copy link
Owner

Mottie commented Jan 28, 2016

Hi @eltharin!

Thanks for your contribution!

Would you share the circumstances of when you see double? I created this demo which triggers an "updateAll" and I don't see double entries in the columnselector div.

@eltharin
Copy link
Author

Hi

When I have Big table to load, I print my table without ligne, i load tablesorter,
After In ajax i get the content of table, put in on the cache :

$.tablesorter.updateCache($(id_div_tableau).get(0).config,function(){},$(''+data+''));

After i refresh all widgets

$(id_div_tableau).trigger('refreshWidgets', true);

And at this moment I have all elements duplicated.

Maybe it’s not the good way ?

Roman JOLY

@Mottie
Copy link
Owner

Mottie commented Jan 28, 2016

Ahh, yes... the tbodies parameter in the updateCache method is supposed to be a jQuery selector pointing to tbodies. In the docs, you'll see this message:

In v2.22.2, a new parameter was added to allow passing a jQuery object containing tbodies (for the tbody sorting widget)

I'll fix the wording, but in your case don't include that extra parameter.

@eltharin
Copy link
Author

I’m using this method beacause i have a 5000’s lignes table and it’s a « little » long to load before in a navigator and then load the pager.

Roman JOLY

De : Rob G [mailto:[email protected]]
Envoyé : jeudi 28 janvier 2016 14:43
À : Mottie/tablesorter [email protected]
Cc : eltharin [email protected]
Objet : Re: [tablesorter] clear column container when refreshing (#1145)

Ahh, yes... the tbodies parameter in the http://mottie.github.io/tablesorter/docs/#updatecache updateCache method is supposed to be a jQuery selector pointing to tbodies. In the docs, you'll see this message:

In v2.22.2, a new parameter was added to allow passing a jQuery object containing tbodies (for the tbody sorting widget)

I'll fix the wording, but in your case don't include that extra parameter.


Reply to this email directly or view it on GitHub #1145 (comment) . https://github.com/notifications/beacon/AHMrmhPB12V3M43iBzPrF1xYTNAXtMcAks5pehJRgaJpZM4HOLtx.gif

@Mottie
Copy link
Owner

Mottie commented Jan 28, 2016

Ok, if you want to use that parameter, and everything else works for you, then I don't have a problem with this PR 😁

Mottie added a commit that referenced this pull request Jan 28, 2016
clear column container when refreshing
@Mottie Mottie merged commit 06c1d3a into Mottie:master Jan 28, 2016
@Mottie
Copy link
Owner

Mottie commented Jan 28, 2016

Hmm, whoops, that actually causes an error.

Mottie added a commit that referenced this pull request Jan 28, 2016
@Mottie
Copy link
Owner

Mottie commented Jan 28, 2016

Ok, that should fix the problem... I saw that error when I used $('table').trigger('refreshWidgets'); and the remove function is called on tables that don't have the column selector applied.

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

Successfully merging this pull request may close these issues.

2 participants