Navigation not working in IE 7/8

Navigation not working in IE 7/8

wcmaneswcmanes Posts: 19Questions: 1Answers: 0
edited August 2009 in Bug reports
Hi Allan,

First, thank you for you wonderful tool and all the time you give so generously to help people with it.

We are having a problem where the navigation buttons do not work in IE 7/8, but seem to work fine in all other browsers. We are using the latest beta of 1.5 (beta 11) and we have the same problem with several pages. I know these type problems are usually due to HTML issues, so I have made sure this particular page passes W3C validation with no errors at all.
The URL is: http://ragsmdev.ucr.edu/agsmevents/index.php

I can see that the button event is firing and something happens, as the page redraws, but it simple does not advance to the next page of data in the table.

Thank you again,
Bill Manes
UC Riverside

Replies

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Hi Bill,

    That's a good one! I can honestly say, I don't have a clue what is causing the problem - sorry! If I had to guess, I would say that there is another event handler on the element, and that is capturing the click and then throwing it away before DataTables can see it. I'm going to be updating my Visual Event tool for jQuery.live() and IE soon (tonight if I get the time) and that would answer that question...

    I see you have a lot of JS libraries being loaded on that page. What happens if you strip everything out apparent from jQuery and DataTables? Does the problem still occur?

    Regards,
    Allan
  • wcmaneswcmanes Posts: 19Questions: 1Answers: 0
    I'll see if I an track anything down. I am loading several other jQuery plugins, but most are not used on this page. The only other event handler I have set is for window resize to resize the table when the user drags the window. I guess this could be interfering so I'll try commenting it out. If I can get to the bottom of this I'll let you know what I find.

    Thanks for taking a look. It really is amazing how much you do to support DataTables.

    Bill
  • wcmaneswcmanes Posts: 19Questions: 1Answers: 0
    well, that was a quick test. It is the window resize event handler interfering w/ DataTables. Can't see how this would be triggering by clicking on a button, but it is IE so who knows what's going on.

    I like the "auto resize" functionality, but looks like it's coming out :(

    Bill
  • fliesflies Posts: 35Questions: 0Answers: 0
    wcmanes: don't know if you are using button element, but i had a problem with click event if it's type attribute wasn't set:
    next - sometimes worked sometimes not
    next - always works

    Don't know if it's in your case, but maybe someone will make use of it.
  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Hi wcmanes,

    Interesting - but a good find!

    There is an easier way of resizing the table automatically, and without Javascript. What to do is set bAutoWidth to false during initialisation and in your HTML, give each of the TH elements a % width. That way the browser will do all the hard work for you :-)

    Regards,
    Allan
  • wcmaneswcmanes Posts: 19Questions: 1Answers: 0
    Got this worked out (sort of)...

    Near as I can tell, any action that causes DataTables to update in the table display (filter, navigation, etc.) makes IE fire a window resize event. This does not occur in other browsers. I have a window resize event handler that changes the width of the table and then redraws:

    $("#eventlist").css("width",winWidth + "px");
    oTable.fnDraw()

    Of course this resets the table back to the 1st page (not great). I fixed the basic problem by checking that the width of the window actually did change before resizing it:

    if (Math.abs(winWidth - lastWidth) >= 20) {
    lastWidth = winWidth;
    $("#eventlist").css("width",winWidth + "px");
    oTable.fnDraw();
    }

    This works, but does have an unintended down side. If the user has navigated to a page other than the 1st page, the fnDraw method puts him back on the 1st page. Is there any way to get fnDraw to redraw but at the same list location?
  • wcmaneswcmanes Posts: 19Questions: 1Answers: 0
    I'd rather not fix the column widths, even as pct. There are 4 columns that are dependent on user input and can vary greatly in width. I'd rather have the browser do it's thing. But I guess I can't have everything...
  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Hi wcmances,

    Yes it's possible to keep the paging at the same place after a draw, but it involved an extra step. You need to record what page you are currently on, then do the draw, and finally jump back to the required page (it's so fast the user will never see it).

    See this conversation for details:
    http://datatables.net/forums/comments.php?DiscussionID=422

    Allan
  • wcmaneswcmanes Posts: 19Questions: 1Answers: 0
    Thanks Allan. You and DataTables are awesome!
This discussion has been closed.