DICE PACKS BUNDLE
  1. #1

    Windowlist is sorting the LAST entry added first

    I recently had this popup on a windowlist. Here is the list of controls of "name"

    Code:
    'Combat Tracker'
    'Party Sheet'
    'Calendar'
    'Colors'
    'Lighting'
    'Options'
    'Modifiers'
    'Effects'
    'Tokens'
    'Library'
    'Modules'
    'Audio'
    'Kits'
    'Encounters'
    'Characters'
    'Classes'
    'Images'
    'Items'
    'Notes'
    'NPCs'
    'Quests'
    'Races'
    'Skills'
    'Spells'
    'Story'
    'Tables'
    'Parcels'
    The window list looks something like this:

    Code:
      <template name="menu_records_list">
        <windowlist>
           <anchored >
              <top offset="5" />
              <left offset="5" />
              <right offset="-5"/>
              <bottom offset="-5" />
            </anchored>            
          <frame name="darkbox" offset="5,5,5,5" />
          <skipempty />
          <noscroll />
          <class>menu_record_item</class>
          <sortby><control>name</control></sortby>
        </windowlist>
      </template>
    And this is the "menu_record_item" windowclass.
    Code:
     <windowclass name="menu_record_item" >
        <sheetdata>
          <hs name="path" />
          <hs name="record" />
          <hn name="insert" />
          <hs name="name" />
          <label name="record_name">
            <anchored height="20">
              <top offset="0"/>
              <left offset="4" />
              <right offset="-4" />
            </anchored>        
          <font>reference-b-light</font>
          </label>
        </sheetdata>
      </windowclass>
    So, as you can see from the windowlist template it should be sorting by "name" which is the first block of the post. This and others using the same template ALL sort the last entry on the windowlist FIRST in the windowlist. It looks like this.



    I double checked that each menu_record_item had the "name" set and the getValue() returned the expected string... it did.

    Runtime Notice: s'menu_record_item' | s'onClickDown' | s'window.name.getValue()' | s'Parcels'

    Forcing an windowlist.applySort(true); doesn't seem to help either.

    Anyone see an obvious reason why? I've two others and they both do the exact same thing... /boggle.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  2. #2
    Quote Originally Posted by celestian View Post
    Forcing an windowlist.applySort(true); doesn't seem to help either.
    So, I changed where I was running this and it now sorts properly. I debugged the sorting going on and it appears that adding a window to the list didn't update on the last entry added to the windowlist.

    Adding this at the end of the loop that added everything resolved that. I'm not sure why it works this way but ... this works.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •  
Starfinder Playlist

Log in

Log in