You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by SmileySnr <li...@dit.ie> on 2014/04/03 15:20:34 UTC
Filter a dropdown list
Environment: FlashBuilder 4.6, Wamp 2.4 with Zend Framework.
mySql
7 base tables
lecturers
students
modules
ulms
studentprogress
studentmodules
modulecontents
I want to setup filtering across a number of the tables ... just one example
is explained below;
ModulesContents is a table which shows which ULMs are in which Module
I use dropdownlists when adding data to this table ...
dropdownlist 1 (to list all the modules currently in the DB)
dropdownlist 2 (to list all the ulms in the DB) and finally
dropdownlist 3 (to list all the lecturers in the DB)
These all work to a fashion. They all indeed return lists of all the
elements in the database.
Lets look at some data
Modules Table
Module1,Module2,Module3,...
Ulms Table
Ulm1, Ulm2,Ulm3,Ulm4,Ulm5,Ulm6,...
Each module can contain upto 8 ULMs (Units of Learning Material).
A sample ModuleContents table might look like
Module 1 Ulm1
Module 1 Ulm2
Module 1 Ulm3
Each time I click the dropdown menu for Ulms with Module1 selected, I see
the full list of Ulms.
Ulm1, Ulm2,Ulm3,Ulm4,Ulm5,Ulm6,...
What I would like to see is a filtered list based on what is NOT in the
module already
ie in this case ...
Ulm4,Ulm5,Ulm6,...
Any idea How I could do this?
Any help would be appreciated
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Filter-a-dropdown-list-tp5968.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: Filter a dropdown list
Posted by SmileySnr <li...@dit.ie>.
Im struggling to find how to attach the property filterfunction to one of the
objects in my code.
The best place to attach the property would be, I think when the selection
is made
The dropdownlist creation and selection are shown below
eg
public function dropDownList_Mn_create(event:FlexEvent):void
{
ddl_ModuleNamesResult.token =
modulesnamesService.getAllModules_names();
}
public function dropDownList_Mn_change(event:IndexChangeEvent):void
{
moduleID = dropDownList_moduleid.selectedItem.module_id;
if (moduleID > 0) {
dropDownList_ulmid.enabled = true;
}
}
I dont know how or where to apply the filterfunction property,
can you advise.
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Filter-a-dropdown-list-tp5968p5982.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: Filter a dropdown list
Posted by Tom Chiverton <tc...@extravision.com>.
On 03/04/14 15:21, SmileySnr wrote:
> That sounds like what I need.
>
> Can you point me at any examples to get me started?
>
>
I'd always start at the docs :
http://flex.apache.org/asdoc/mx/collections/ListCollectionView.html#filterFunction
There's plenty of older but still valid examples lying around in Google too.
Tom
Re: Filter a dropdown list
Posted by SmileySnr <li...@dit.ie>.
That sounds like what I need.
Can you point me at any examples to get me started?
Thanks
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Filter-a-dropdown-list-tp5968p5970.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: Filter a dropdown list
Posted by Tom Chiverton <tc...@extravision.com>.
On 03/04/14 14:20, SmileySnr wrote:
> What I would like to see is a filtered list based on what is NOT in the
> module already
>
> ie in this case ...
>
> Ulm4,Ulm5,Ulm6,...
I'd assign a filterFunction to the drop down's dataProvider.
Tom