mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
22 lines
542 B
TypeScript
22 lines
542 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();
|
|
}
|