View Single Post
06/14/21, 02:06 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,976
afaik you can only use, via function ZO_ScrollList_EnableSelection, the ZO_SortFilterList's callback function selectCallback which you need to define then.
But this is fired as the row is selected, not a single column!
Reacting to a single column is not possible afaik as the row is mouse enabled and always "overwrites" the mouse handlers for the single columns.
At least I did not manage to get it to work yet.
e.g. I tried to enable a <OnMouseUp> handler within the row's virtual template XML columns. But it never fired.

Lua Code:
  1. local selectCallback = function(previouslySelectedData, selectedData, reselectingDuringRebuild)
  2. --do stuff
  3. end
  4.  
  5. ZO_ScrollList_AddDataType(scrollListControl, dataTypeId, templateName, rowHeight, setupFunction, rowHideCallback, dataTypeSelectSound, resetControlCallback)
  6.     ZO_ScrollList_EnableSelection(scrollListControl, selectTemplate, selectCallback)

To your question about multiple lists:
You could build 3 ZO_SortFilterLists via XML templates.
See here how:
https://wiki.esoui.com/How_to..._do_...templated_rows

Name them list1, list2 and list3 and give them their XML row templates with the columns you need.

As the functions of ZO_SortFilterList fire in this order:
ZO_SortFilterList:RefreshData() => BuildMasterList() => FilterScrollList() => SortScrollList() => CommitScrollList()

Enable the row selection in list1, like shown above via ZO_ScrollList_EnableSelection, and in the selectCallback define some code to update the entries of the list 2 according to your selection in list 1.
You can use the function list2:RefreshData() which will call list2:BuildMasterList() and list2:FilterScrollList() etc then.

And update the entries of list3 as the list2's CommitScrollList function is called so that entries in list3 are based on list2.

This way you can filter the list3 based on list 2 entries, list2 based on the selected enty of list1 as well.

Last edited by Baertram : 06/14/21 at 02:12 AM.
  Reply With Quote