Skip to content
Browse files

filter with reload coverflow

  • Loading branch information...
1 parent b8fc02c commit 461387062fcdf198a15fb27bf546aab928d8a920 @astucchi committed Oct 24, 2011
View
67 src/org/kdata/mobile/presentation/DetailsView.mxml
@@ -21,62 +21,14 @@
import org.kdata.mobile.events.DetailsEvent;
import org.kdata.mobile.presentation.skin.DetailsViewSkin;
- import spark.components.List;
-
[Inject] [Bindable]
public var model:MainPresentationModel;
[Bindable]
private var dataList:ArrayCollection = new ArrayCollection();
-
- private var checkElementIndex:ArrayCollection = new ArrayCollection();
-
-/* private function filter(e:MouseEvent = null):void
- {
- var doc:Document = new Document();
-
- for(var i:int = 0 ; i<checkElementIndex.length ; i++)
- {
- var chekelement:LabelCheckBox1 = vgroup.getElementAt(checkElementIndex[i]) as LabelCheckBox1;
- if (chekelement.selected)
- {
- doc.put(chekelement.id+".text",chekelement.data.text);
- model.checkedDoc[chekelement.id.toString()]=true;
- }
- else
- model.checkedDoc[chekelement.id.toString()]=false;
- }
-
- model.docSelected=doc;
- dispatchEvent(new Event("filterReload"));
- model.load();
- } */
-
-/* [MessageHandler] public function dataChange(e:Event = null):void
- {
- vgroup.removeAllElements();
- var i:int=0;
- var obj:Object=model.selectedDocument;
- for(var o:String in obj)
- {
- if(getQualifiedClassName(obj[o]) == getQualifiedClassName(Object))
- {
- if(o!="titolo")
- {
- var element:LabelCheckBox1= new LabelCheckBox1();
- element.addEventListener(MouseEvent.CLICK,filter);
- element.data = obj[o];
- element.selected=model.checkedDoc[element.id.toString()];
- vgroup.addElement(element);
- checkElementIndex.addItem(i);
- i++;
- }
- }
- }
- } */
-
+
[MessageHandler] public function filter(e:DetailsEvent):void
{
switch(e.type)
@@ -97,6 +49,23 @@
case DetailsEvent.FILTER_CHANGE:
{
+ var doc:Document = new Document();
+
+ for each(obj in model.selectedDocument as Object)
+ {
+ if(getQualifiedClassName(obj) == getQualifiedClassName(Object))
+ {
+ if(obj.visible == true || obj.checked == true)
+ {
+ doc.put(obj.label + ".text" , obj.text)
+ }
+ }
+
+ }
+ model.docSelected=doc;
+ dispatchEvent(new Event("filterReload"));
+ model.load();
+ break;
break;
}
View
2 src/org/kdata/mobile/presentation/MainPresentationModel.as
@@ -16,8 +16,8 @@ package org.kdata.mobile.presentation
[Bindable] public var selectedDocument:Object;
[Bindable] public var docSelected:Document = new Document();
[Bindable] public var index:int = -1;
- [Bindable] public var checkedDoc:Object = new Object();
[Bindable] public var isLoading:Boolean = true;
+
[MessageDispatcher] public var dispatchMessage:Function;
public function getInitialImgList():void
View
4 src/org/kdata/mobile/presentation/component/TouchCheckBox.mxml
@@ -26,12 +26,12 @@
enabled = (data.visible == "true" );
label = data.text;
id = data.label;
- _data.cheked = selected
+ _data.checked = selected
}
protected function click_Handler(event:MouseEvent):void
{
- _data.cheked = selected;
+ _data.checked = selected;
dispatchMessage(new DetailsEvent(DetailsEvent.FILTER_CHANGE));
}

0 comments on commit 4613870

Please sign in to comment.
Something went wrong with that request. Please try again.