@@ -841,6 +841,14 @@ function TradeQueryClass:UpdateDropdownList(row_idx)
841841 self .controls [" resultDropdown" .. row_idx ].selIndex = 1
842842 self .controls [" resultDropdown" .. row_idx ]:SetList (dropdownLabels )
843843end
844+ function TradeQueryClass :ResetResultRow (rowIdx )
845+ self .itemIndexTbl [rowIdx ] = nil
846+ self .sortedResultTbl [rowIdx ] = nil
847+ self .resultTbl [rowIdx ] = nil
848+ self .totalPrice [rowIdx ] = nil
849+ self :UpdateDropdownList (rowIdx )
850+ self .controls .fullPrice .label = " ^7Total Price: " .. self :GetTotalPriceString ()
851+ end
844852function TradeQueryClass :UpdateControlsWithItems (row_idx )
845853 local sortMode = self .itemSortSelectionList [self .pbItemSortSelectionIndex ]
846854 local sortedItems , errMsg = self :SortFetchResults (row_idx , sortMode )
@@ -857,10 +865,7 @@ function TradeQueryClass:UpdateControlsWithItems(row_idx)
857865
858866 self .sortedResultTbl [row_idx ] = sortedItems
859867 if not sortedItems [1 ] then
860- self .itemIndexTbl [row_idx ] = nil
861- self .totalPrice [row_idx ] = nil
862- self .controls .fullPrice .label = " Total Price: " .. self :GetTotalPriceString ()
863- self :UpdateDropdownList (row_idx )
868+ self :ResetResultRow (row_idx )
864869 self :SetNotice (self .controls .pbNotice , " ^4No compatible items found for this slot." )
865870 return
866871 end
@@ -1134,11 +1139,7 @@ you can add them, copy the link here, and press "Price Item" to evaluate the ite
11341139 return m_min (m_max (index or 1 , 1 ), self .sortedResultTbl [row_idx ] and # self .sortedResultTbl [row_idx ] or 1 )
11351140 end
11361141 controls [" changeButton" .. row_idx ] = new (" ButtonControl" , { " LEFT" , controls [" name" .. row_idx ], " LEFT" }, {135 + 8 , 0 , 80 , row_height }, " << Search" , function ()
1137- self .itemIndexTbl [row_idx ] = nil
1138- self .sortedResultTbl [row_idx ] = nil
1139- self .resultTbl [row_idx ] = nil
1140- self .totalPrice [row_idx ] = nil
1141- self .controls .fullPrice .label = " ^7Total Price: " .. self :GetTotalPriceString ()
1142+ self :ResetResultRow (row_idx )
11421143 end )
11431144 controls [" changeButton" .. row_idx ].shown = function () return self .resultTbl [row_idx ] end
11441145 controls [" resultDropdown" .. row_idx ] = new (" DropDownControl" , { " TOPLEFT" , controls [" changeButton" .. row_idx ], " TOPRIGHT" }, {8 , 0 , 351 , row_height }, {}, function (index )
0 commit comments