• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 3.x Series
    • Bug
    • Sortable tables problem and question

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: Sortable tables problem and question

    • Issue Tools
      • View Changes
    1. issueid=2599 February 3, 2012 12:48 AM
      Feathers&Photos Feathers&Photos is offline
      New Member
      Sortable tables problem and question

      I'm trying to create a table with columns that are sortable. A snippet of the code I'm using below.
      Code:
      [TABLE]  class="sortable"
      !  class="blocksubhead sorttable_nosort" style="background-color: rgb(238,232,170)" ! [B]Member[/B]
      !  class="blocksubhead sorttable_numeric" style="background-color: rgb(238,232,170)" ! [B]Amount[/B]
      !  class="blocksubhead sorttable_numeric" style="background-color: rgb(238,232,170)" ! [B]Amount Two[/B]
      |- 
      | Member1
      | 170
      | 300
      |-
      This seems to work fine, but when a wiki contributor enters any data using the advanced editor, the class code is changed in the header and I lose the sort classes...

      Code:
      [TABLE]  class="sortable"
      !  class="blocksubhead" style="background-color: rgb(238,232,170)" ! [B]Member[/B]
      !  class="blocksubhead" style="background-color: rgb(238,232,170)" ! [B]Amount[/B]
      !  class="blocksubhead" style="background-color: rgb(238,232,170)" ! [B]Amount Two[/B]
      |- 
      | Member1
      | 170
      | 300
      |-

      Secondly, when you click the header to sort on the first column, then on the second and finally back to the first column again, it doesn't sort just on the first column. It also uses the sort applied to the second column. Is there anyway to stop this behaviour so it just sorts on the column header clicked on?

      Thanks in advance
    Issue Details
    Issue Number 2599
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category BB-Code Parsing
    Status Fixed
    Priority 6 - Dev-Related Tasks
    Affected Version 3.0.16
    Fixed Version 3.0.17
    Milestone (none)
    Software DependencyAny
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. February 4, 2012 4:22 AM
      pegasus pegasus is offline
      VaultWiki Team
      I will look into the advanced editor stripping the classes.

      As for stopping the multi-sort, I'm not sure. The sorttable.js is an open-source plugin that we have included for convenience. I will need to read through the code again to refresh my memory what it can and can't do. There might be a single-sort class or you might need to do something like double-click to remove the sort from a column. If there's no way, we would have to make a custom solution.
      Reply Reply  
    2. February 4, 2012 5:09 AM
      Feathers&Photos Feathers&Photos is offline
      New Member
      Thanks Pegasus, appreciate the effort and I look forward to a solution!
      Reply Reply  
    3. February 5, 2012 8:11 PM
      Feathers&Photos Feathers&Photos is offline
      New Member
      I've replaced the sorttable.js with the one HERE and it seems to behave correctly with regards to sorting. You can sort one column after another and it always sorts on the column you click only, so I'm not sure what the problem is?
      Reply Reply  
    4. February 9, 2012 12:35 AM
      Feathers&Photos Feathers&Photos is offline
      New Member
      Hi Pegasus, I was wondering if there's been any resolution to these issues at all? I'm not sure if you'd post the response to the issues in here or elsewhere?

      Thanks
      Reply Reply  
    5. February 9, 2012 2:31 PM
      pegasus pegasus is offline
      VaultWiki Team
      Can you please post a table here where there is a multi-sort in effect?
      Reply Reply  
    6. February 9, 2012 2:38 PM
      pegasus pegasus is offline
      VaultWiki Team
      As for the classes being removed by the editor, please try the following edit to vault/class/bbcode/ckeditor.php. Find:
      Code:
      		$this->validate_table_attributes('td', $attributes);
      
      		$cell_out = "! " . ($attributes ? $attributes . " ! " : "") . $this->strip_front_back_whitespace($text);
      Replace with:
      Code:
      		$this->validate_table_attributes('th', $attributes);
      
      		$cell_out = "! " . ($attributes ? $attributes . " ! " : "") . $this->strip_front_back_whitespace($text);
      Reply Reply  
    7. February 10, 2012 9:02 PM
      Feathers&Photos Feathers&Photos is offline
      New Member
      I'll give that a shot Pegasus, thanks.

      I've added a multi-sort table where you requested and the sorts do mess up once you've sorted a few tables.

      I actually noticed the problem in this example you gave HERE when I was looking up the possibility of doing a table sort. If you sort the Alpha column, then the Numeric column when you go back to sorting the Alpha column it won't sort correctly.

      Cheers
      Reply Reply  
    8. February 11, 2012 2:40 AM
      pegasus pegasus is offline
      VaultWiki Team
      Fixed. In clientscript/vault/sorttable.js, find:
      Code:
      								YAHOO.util.Dom.removeClass('sorttable_sorted_reverse');
      								YAHOO.util.Dom.removeClass('sorttable_sorted');
      Replace with:
      Code:
      								YAHOO.util.Dom.removeClass(cell, 'sorttable_sorted_reverse');
      								YAHOO.util.Dom.removeClass(cell, 'sorttable_sorted');
      Reply Reply  
    9. February 11, 2012 6:08 AM
      Feathers&Photos Feathers&Photos is offline
      New Member
      Thanks very much for your support Pegasus, both those seem to have fixed the problems!

      Cheers!!!
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 12:07 AM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2023 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
    Copyright © 2008 - 2013 VaultWiki Team, Cracked Egg Studios, LLC.