PDA

View Full Version : YAHOO.ext.grid.DefaultSelectionModel.selectRowsByI d bug


kovtik
11-01-2006, 04:18 PM
Look at the following code from SelectionModel.js:YAHOO.ext.grid.DefaultSelectionM odel.prototype = {
//...
/**
* Set the selected rows by their ID(s). IDs must match what is returned by the DataModel getRowId(index).
* @param {String/Array} id The id(s) to select
* @param {Boolean} keepExisting (optional) True to retain existing selections
*/
selectRowsById : function(id, keepExisting){
var rows = this.grid.getRowsById(id);
this.selectRows(rows, keepExisting);
},
//...
};
Should be
selectRowsById : function(id, keepExisting){
var rows = this.grid.getRowsById(id);
if (!(rows instanceof Array)){
this.selectRow(rows, keepExisting);
return;
}
this.selectRows(rows, keepExisting);
},

jack.slocum
11-02-2006, 12:37 AM
Thanks. grid.getRowsById used to always return an array. That was changed at one point and this function must have fell behind. Thanks for providing a fix as well.

Jack