Skip to content

Instantly share code, notes, and snippets.

@serge-hulne
Created November 23, 2020 17:27
Show Gist options
  • Select an option

  • Save serge-hulne/b9ab7a56b7e13ddf43c2e3c1e4942121 to your computer and use it in GitHub Desktop.

Select an option

Save serge-hulne/b9ab7a56b7e13ddf43c2e3c1e4942121 to your computer and use it in GitHub Desktop.
Taks List Wiget
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