Cannot Iterate through DataView

I display data in a HTML template that works fine. I have added and onXLE event. I have two records that are displayed but when I iterate through all I get is the same ID.

myDataView.attachEvent("onXLE", function (){
	var items = myDataView.dataCount();
	var id, data;
	
	if(items > 0) {
		id = myDataView.first();
		data = myDataView.get(id);
		alert(id);
		for(var loop = 0; loop < items; loop++) {
			id = myDataView.next();
			data = myDataView.get(id);
			alert("Loop: "+loop+" ID: "+id);
		}
	}	

});

There was an omission in documentation. Method next() nedd a parameter ID. Just past it here:
id = myDataView.next(id);

docs.dhtmlx.com/doku.php?id=dhtm … iew_next&s[]=next