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

issue with Microsoft ajax.net #119

Closed
gilstrac opened this issue Aug 10, 2012 · 6 comments
Closed

issue with Microsoft ajax.net #119

gilstrac opened this issue Aug 10, 2012 · 6 comments
Labels
Milestone

Comments

@gilstrac
Copy link

Site with a mixture of jquery and microsoft ajax.net controls.

Bind to the ajax ready so it resets the jquery stuff.

The trigger update was taking longer and longer.
It appeared the events were being bound over and over.

I am sure it is not the best way to fix it since I just started using this today but at the init

//done so ajax.net does make it take longer the more updates
$headers.unbind('mousedown.tablesorter mouseup.tablesorter');
$this.unbind('update updateCell addRows sorton appendCache applyWidgetId applyWidgets destroy mouseup mouseleave');

This was added in the construct right before event binding occurs.

Any suggestions are welcome.
Cheers

@thezoggy
Copy link
Collaborator

sounds like you are binding the wrong sort of events.. if i recall correctly you should never do mousedown/up as it results in multiple states and different results in different browsers. why jquery does a click / delgate.

@Mottie
Copy link
Owner

Mottie commented Aug 10, 2012

In the upcoming version, I've added a check to prevent tablesorter from being initialized multiple times on the same table.

ts.construct = function(settings) {
    return this.each(function() {
        // if no thead or tbody, or tablesorter is already present, quit
        if (!this.tHead || this.tBodies.length === 0 || this.hasInitialized === true) { return; }

Also, all of that unbinding occurs when you destroy the table.

@gilstrac
Copy link
Author

I think this is great fix. I am not sure this will fix this issue. It has something to do with the AJax.net stuff. It is as if the dom objects are destroyed but the event references remain. I think this may be related after some more looking...

http://stackoverflow.com/questions/2664651/updatepanel-refresh-messing-up-jqueryui-in-ie7

@Mottie
Copy link
Owner

Mottie commented Aug 11, 2012

Yeah, from reading that answer, it seems like the best solution for you would be to destroy tablesorter then reinitialize it again.

But I guess, unbinding before binding wouldn't hurt in this case. So you said you had it working with that change?

@gilstrac
Copy link
Author

yes

On Fri, Aug 10, 2012 at 5:18 PM, Rob G notifications@github.com wrote:

Yeah, from reading that answer, it seems like the best solution for you
would be to destroy tablesorter then reinitialize it again.

But I guess, unbinding before binding wouldn't hurt in this case. So you
said you had it working with that change?


Reply to this email directly or view it on GitHubhttps://github.com//issues/119#issuecomment-7662154.

Mottie added a commit that referenced this issue Sep 27, 2012
@Mottie
Copy link
Owner

Mottie commented Sep 27, 2012

Fixed in version 2.4... sorry for taking so long!

@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
Projects
None yet
Development

No branches or pull requests

3 participants