1. No Profile Picture
    Super Moderator
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jun 2009
    Hartford, WI
    Rep Power

    Adjust default sort for a table

    Hey all. I'm not really a JavaScript person, but am trying to help a friend with a little something. This page offers a table, in which, you can click either header to sort column by. Everything works. We just need a little help in knowing what we'd be looking for to alter how the page loads by default. Currently sorting alphabetically, we wish to load sorting by rank. I've looked through all the PHP, and have found some defaults in a .js file, but not what needed.

    The site is http://ancientredemption.jtgcomputers.com/ and the component spoken of is the Guild Roster on left, know as com_raidplanner. The 3 .js files in use are:
    Folder: components/com_raidplanner/

    Any help/input is greatly appreciated. Thank you.
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    USA (verifiably)
    Rep Power
    It seems to be using the script's default. You need to set the sortIndex and maybe the sortReverse properties in the embedded script.
    var rosterTable = new HtmlTable(
    		properties: {
    			border: 0,
    			cellspacing: 1,
    			cellpadding: 5
    		sortable: true,
    		sortIndex: 5,
    		zebra: true,
    		selectable: true,
    		allowMultiSelect: false,
    Spreading knowledge, one newbie at a time.

    Learn CSS. | PHP includes | HTML Validator | CSS validator

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo