Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private updateListItem(args: ListViewEventData) {
let item;
let listView = this.nativeView;
let items = listView.items;
if (args.index >= items.length) {
logger.warn("Got request for item at index that didn't exist");
return;
}
//groups have index less than zero
if (args.index < 0) {
this.updateViewWithProps(args.view, { item: args.view.bindingContext.category } );
return;
}
if (items.getItem) {
item = items.getItem(args.index);
} else {
item = items[args.index]
}
this.updateViewWithProps(args.view, { item });