SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot
    Join Date
    May 2003
    Location
    Sarasota, FL
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Anyone using TableFilter script (for jQuery) with IE8?

    I'm trying to update a site for compatibility with IE8, but one script still isn't working. It's the TableFilter script available from http://ideamill.synaptrixgroup.com/, and it's used pretty heavily on this site. I can get it to work if I use the IE=5 compatibility mode:

    Code:
    <meta http-equiv="X-UA-Compatible" content="IE=IE5" />
    but then other CSS quirks show up. The script doesn't work with IE=IE7 nor IE=Emulate IE7, even though the script works fine in IE7 itself...

    Anyways, is anyone using it successfully in IE8, and if so, what did you patch? The script source hasn't been updated by the author in over a year, and I'm nervous about having to replace the script with some other table filter/sorter script given how much it's used though out the site.
    Chris Bloom
    Web Application Developer

  2. #2
    SitePoint Zealot
    Join Date
    May 2003
    Location
    Sarasota, FL
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I've got it working now by using the EmulateIE7 compatibility meta tag, AND changing line 84 in tableFilter.js to the following:
    Code:
    this.browserSucks = jQuery.browser.msie && (parseInt(jQuery.browser.version) < 8);
    Chris Bloom
    Web Application Developer

  3. #3
    SitePoint Zealot
    Join Date
    May 2003
    Location
    Sarasota, FL
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, actually just modifying the tableFilter.js script is enough. There is no need to add any compat. tags, at least as far as this bug goes.
    Chris Bloom
    Web Application Developer

  4. #4
    SitePoint Member
    Join Date
    May 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,
    I have the same problem, I tried to modify the script as you suggested, I see the fields to filter the table now with IE8, but then the filter does not work. Do you have the same problem?

  5. #5
    SitePoint Zealot
    Join Date
    May 2003
    Location
    Sarasota, FL
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, good catch. I didn't test the filtering part. This seems to work: change line 800 in jquery.tableFilter.js to this:

    Code:
    text = (!this.browserSucks && cell.textContent) ? cell.textContent.trim() : cell.innerText.trim();
    Chris Bloom
    Web Application Developer

  6. #6
    SitePoint Zealot
    Join Date
    May 2003
    Location
    Sarasota, FL
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, I just realized that that was in my modified version of the script (I added the forceTextFilterWhenAllRowsAreUnique property; See http://pastie.org/308896.txt), but the line you need to change should still be there. Just search for:

    Code:
    text = (!this.browserSucks) ? cell.textContent.trim() : cell.innerText.trim();
    Chris Bloom
    Web Application Developer

  7. #7
    SitePoint Member
    Join Date
    May 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help, I tried this variation, but there is no way to make it work.
    It could be a css problem since I do not have javascript errors ?

    Even in the website
    ideamill.synaptrixgroup.com/?p=13
    the demo does not work.

    Any other suggestions, and help is appreciated.
    Thank you.

  8. #8
    SitePoint Zealot
    Join Date
    May 2003
    Location
    Sarasota, FL
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you post a link to the page you're having trouble with? I got it working OK using the changes above. You might try adding a compatibility tag like this just to see if it helps.

    Code:
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    Chris Bloom
    Web Application Developer

  9. #9
    SitePoint Zealot
    Join Date
    May 2003
    Location
    Sarasota, FL
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just noticed that some of my tables weren't paging properly. After looking at the code, I'm not sure they ever did, but maybe I just didn't have large enough tables to notice. The problem occurred if the table you were applying the filterTable to had an underscore in the ID, like "some_table". The fix is easy. Just find the line that contains
    Code:
    var p = e.target.id.indexOf("_") + 5;
    and replace it with
    Code:
    var p = e.target.id.lastIndexOf("_") + 5;
    Chris Bloom
    Web Application Developer


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •