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);
		for(var loop = 0; loop < items; loop++) {
			id =;
			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 =; … iew_next&s[]=next