mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 05:18:39 +08:00

* test: list items relayout example * fix(list-view): Layout list-view items on request * refactor(tests): refactor list-view tests imports
21 lines
541 B
TypeScript
21 lines
541 B
TypeScript
import { fromObject } from "tns-core-modules/data/observable";
|
|
|
|
export function loaded(args) {
|
|
var items = [];
|
|
|
|
for (let i = 0; i < 100; i++) {
|
|
items.push(fromObject({
|
|
text: "<" + i + ">",
|
|
selected: !!!(i % 5)
|
|
}));
|
|
}
|
|
args.object.bindingContext = { items: items };
|
|
}
|
|
|
|
export function toggle(args) {
|
|
console.log("toggle : ")
|
|
let context = args.object.bindingContext;
|
|
console.dir(context);
|
|
context.set("selected", !context.selected);
|
|
// args.object.requestLayout();
|
|
} |