PDA

View Full Version : Minor typo in PagedGridView.prototype.onEnter



jarrod
17 Nov 2006, 11:46 PM
I think there's a typo in the following code - isNaN(v) should be isNaN(pageNum)?



YAHOO.ext.grid.PagedGridView.prototype.onEnter = function(e){
if(e.browserEvent.keyCode == e.RETURN){
var v = this.field.dom.value;
if(!v){
this.field.dom.value = this.cursor;
return;
}
var pageNum = parseInt(v, 10);
if(isNaN(v)){
this.field.dom.value = this.cursor;
return;
}
pageNum = Math.min(Math.max(1, pageNum), this.lastPage);
this.grid.dataModel.loadPage(pageNum);
e.stopEvent();
}
};

jack.slocum
18 Nov 2006, 2:36 AM
Looks like I had the right idea and then forgot to use it. :)