I have a section of a UI where I have a Text label above a Grid. Usually the Text is one line, but there are cases when the data spills onto a second line.
I have written code that I thought would reposition the grid, but it does not have the effect I am looking for
CODE
log("new y? "+this.menuTitle.vOffset+"+"+this.menuTitle.height);
var y2 = this.menuTitle.vOffset+this.menuTitle.height;
if (true) {
this.grid.setStyles({
vOffset: y2,
height: this.height - y2 - this.pi.height
});
this.grid.config.rows = this.rowsForGrid(this.grid.height);
} else {
this.grid.y = y2;
this.grid.height = this.height - y2 - this.pi.height;
this.grid.rows = this.rowsForGrid(this.grid.height);
}
You can see two attempts. The second does not work at all. The first works initially, but as soon as focus passes out of the grid it is re-rendered in its original position, corrupting the rendering of the multi-line Text label above it.
I could not find any instance of the word "reposition" in the YWE Developer Guide. Does the YWE support altering the position and dimensions of UI elements, or should I just create a fresh Grid in the new rectangle when the label resizes itself?