a42a468070
- moved view classes instanciation into CREATION_COMPLETE triggered methods
41 lines
1.0 KiB
Haxe
41 lines
1.0 KiB
Haxe
package view;
|
|
|
|
import feathers.layout.AutoSizeMode;
|
|
import feathers.controls.ListView;
|
|
import feathers.events.FeathersEvent;
|
|
import model.AppModelLocator;
|
|
import openfl.events.Event;
|
|
import t9.util.ColorTraces.*;
|
|
|
|
class RidersList extends ListView {
|
|
private var model = AppModelLocator.getInstance();
|
|
|
|
public function new() {
|
|
super();
|
|
addEventListener(FeathersEvent.CREATION_COMPLETE, onCreationComplete);
|
|
|
|
//width = 300;
|
|
//height = 400;
|
|
}
|
|
|
|
override private function initialize():Void {
|
|
super.initialize();
|
|
|
|
model.addEventListener(AppModelLocator.RIDERS_LIST_DP_CHANGE, onRideListDpChange);
|
|
|
|
}
|
|
|
|
private function onCreationComplete(event:FeathersEvent):Void {
|
|
traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height );
|
|
}
|
|
|
|
private function onRideListDpChange(e:Event):Void {
|
|
dataProvider = model.ridersListDP;
|
|
|
|
itemToText = function(item:Dynamic):String {
|
|
return item.firstName;
|
|
};
|
|
traceGreen(this + " --> onRideListDpChange() - w: " + width + " h: " + height );
|
|
}
|
|
}
|