Categories | Question details Back To List | ||
How can I break the loop of this._grid.forEachRow(function(id){}); and return false; I am using following code for cell data validation. But 'return false' is not breaking the loop. this._grid.forEachRow(function(id){ var notional = this.cells(id,2).getValue(); if(!prototype._validateDecimal(notional,5)) { alert (“Error!”); this.selectCell(this.getRowIndex(id),2); this.editCell(); return false; } }); Answer posted by Support on Mar 06, 2009 05:54 Actually you can't. The only solution - use custom looping code instead of built in one var max = mygrid.getRowsNum(); for (var i=0; i<max; i++){ var notional = this.cells2(i,2).getValue(); if(!prototype._validateDecimal(notional,5)) { alert (“Error!”); this.selectCell(i,2); this.editCell(); return false; } } }); |