PDA

View Full Version : Help On Windowlist Filtering (I Think)



dulux-oz
May 30th, 2013, 10:48
Hi All,

Some coding help please:

1) I've got a three column array of Items and I want to display column1 in a list. The array does not exists within the DB but is constructed from code eg the SkillData Array from the 3rd Ed DnD Ruleset. I think I can use a windowlist construct to do this, but an example would be helpful.

2) I need to filter the list on two of the array's coulmns based on the user input from three controls contained within the parent window. This will allow me to set up a series of and/or conditions ie if control1 filters column2 and control2 and control3 both filter column3 in an "or" situtation ie I acheive a filter of control1.getValue() and (control2.getvalue() or control3.getvale()) - but I'm not sure how to code the filter in the windowlist, so again, an example would be much appreicated.

Thanks in advance

Moon Wizard
May 30th, 2013, 19:10
1) I'm not sure that I follow what you are trying to do here. Windowlists can be source-less (i.e. not tied to the database), just leave off the datasource tag. Then, you can use createWindow to create a window using the default class defined by the windowlist.class tag, or createWindowWithClass to create a window using any class.

2) The onFilter event is called for each child window when the filter is applied to a list. The filter can be applied by calling the windowlist.applyFilter function. The windowinstance object for the child window is passed to the onFilter event, so you can compare the specific child fields to your filter fields using any Lua code you want.

Regards,
JPG

dulux-oz
May 31st, 2013, 05:06
Thanks JPG - that's what I thought (just needed someone to confirm my thinking wasn't going astray) :D