Nativescript Pro UI Listview drag from one group to another


#1

Is there a way to allow for grouping of templates with drag, allowing you to drag from one group to another?

I’ve tried the following:

public onItemReordered(args: ListViewEventData) {
        console.log("Item reordered. Old index: " + args.index + " " + "new index: " + args.data.targetIndex + " group index: " + args.data.targetGroupIndex);
        let item = this._dataItems.getItem(+args.data.targetIndex);
        item['templateType'] = 'drag';
        item['key'] = 'category';
        this._dataItems.setItem(args.data.targetIndex, item);
        console.log(this._dataItems);
    }

The problem I have is it doesn’t allow me to change the key upon drop to allow it to stay in the group. It goes back to it’s original group and the template for the dropped on group changes based on the index of the item I dropped it on.


#2

Does the log confirm the data item is updated?
Did you try reloading the list view?