-
November 21st, 2024, 19:51 #1
- Join Date
- Feb 2021
- Posts
- 443
Want to have the inventory search box multi purpose
I was able to change my inventory search drop down box, originally it only filtered by the item type and was prepopulated, I changed it to filter by name and removed the item type population of the drop down. This is in the template_char.xml file:
<template name="list_charinv">
<windowlist>
<datasource>.inventorylist</datasource>
<class>char_invitem</class>
<allowcreate />
<allowdelete />
<filter control="typefilter" />
<filteron control="name" />
<script file="campaign/scripts/char_invlist.lua" />
</windowlist>
</template>
However, what I would like is that I keep the type in the dropdown, so if they type a word in the box, it searches by name, but if the text value matches an item type (i.e. "Accessory","Armor","Weapon" etc) then it searches by type. Is this possible?
-
November 22nd, 2024, 02:01 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 21,509
You’d have to completely override the list filtering (onFilter) and update of list when the filter box changes. You won’t be able to use the default filtering at all, since you need to write the logic to know which field to check based on the value in the filter box.
Regards,
JPG
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks