Files
NativeScript/apps/ui/app/list-view/item-re-layout-page.ts
Nathan Walker 1e6fccf272 chore: cleanup
2020-07-23 14:03:37 -07:00

24 lines
498 B
TypeScript

import { fromObject } from '@nativescript/core/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();
}