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

Already on GitHub? Sign in to your account

issue with Microsoft ajax.net #119

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

Comments

Projects
None yet
3 participants

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

Collaborator

thezoggy commented Aug 10, 2012

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.

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.

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

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?

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/Mottie/tablesorter/issues/119#issuecomment-7662154.

Mottie added a commit that referenced this issue Sep 27, 2012

Owner

Mottie commented Sep 27, 2012

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

@Mottie Mottie closed this Sep 27, 2012

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