Files
NativeScript/tns-core-modules/ui/list-view
Dirk Rudolph 4bcb9840c1 Expose itemIdGenerator that can be used to generate unique ID for items on ListView (#4964)
* fixed the context of the getItem() call in android's ListView adapter (#4962)

* added itemIdGenerator function to the list-view interface to allow delegating the creating of a unique id for an item to a consumer of the listview (#4962)
2017-12-05 11:53:32 +02:00
..
2016-05-26 14:30:25 +03:00

ListView module.

    var lm  = require("ui/label");
    var lvm = require("ui/list-view");

    var data = [];
    for(var i = 0, l = 1000; i < l; i++) {
       data.push(i);
    }

    var lv = new lvm.ListView();
    lv.items = data;
    lv.on(lvm.ListView.itemLoadingEvent, function(args){
        var label = args.view;
        if(!label) {
            label = new lm.Label();
            args.view = label;
        }
        label.text = "Item " + args.index;
    });