-
May 6th, 2020, 06:27 #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'
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>
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>
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.
-
May 6th, 2020, 20:55 #2
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