How do you add grid sorting to an inventory grid?

Bernkastel

Member
I added a sorter dropdown to an inventory grid using an item info attribute value sorter. I set the attribute equal to a unique integer for each item which should order them in ascending or descending order but nothing happend. I tried binding the sorter and unchecking "sort selected tab only" but no matter what nothing seemed to be getting sorted when items were added or removed from the inventory. Also, is it possible to automatically have an inventory have a sorter without having a dropdown to choose from? Can I not have the dropdown and simply have it automatically sort in a specific order?
 
You can automatically filter and sort your inventory grid. Use the UI Designer Editor, Under the Inventory Grid there's a filter and sorter section (if you are using tabs you should use the filter/sorter under the tab sections, each tab has its own filter/sorter).
 
Perfect, I got it working ty, one question if possible. Is there a built in icomparable for enumerators similar to how you had rarity set up in the demos?
 
I'm not sure there is, doing a quick google search I found this:

But to be fair Enums can be converted to ints very easily. so if its not the case you could create your own custom sorter in just a few lines of code.
 
Top