Created
November 23, 2020 17:27
-
-
Save serge-hulne/b9ab7a56b7e13ddf43c2e3c1e4942121 to your computer and use it in GitHub Desktop.
Taks List Wiget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Button } from "axino/button"; | |
| import { Div } from "axino/div"; | |
| import { Widget } from "axino/widget"; | |
| import { Component } from "axino/core"; | |
| class TaskList extends Widget { | |
| // Data: | |
| list: Component[]; | |
| addButtonWrapper: Div; | |
| addButton: Button; | |
| // Constructor: | |
| constructor(props:any=null) { | |
| super(); | |
| this.list = new Array<Component>(); | |
| //this.vertical(); | |
| this.setBackgroundColor("lightblue"); | |
| this.Border(); | |
| this.Padding("50px"); | |
| this.Width("100%"); | |
| this.addButtonWrapper = new Div(null); | |
| this.addButtonWrapper.appendTo(this); | |
| this.addButtonWrapper.alignCenter(); | |
| this.addButtonWrapper.Width("100%"); | |
| this.addButton = new Button("+"); | |
| this.addButton.onClick(() => { | |
| //log("addButton clicked"); | |
| if (props != null) { | |
| if (props.add != null) { | |
| props.add.send("add"); | |
| } | |
| } | |
| }); | |
| this.addButton.appendTo(this.addButtonWrapper); | |
| this.addButtonWrapper.Width("100%"); | |
| this.addButton.Padding("5px"); | |
| } | |
| } | |
| export { TaskList }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment