/* Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ if(!dojo._hasResource["dojox.grid.DataSelection"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. dojo._hasResource["dojox.grid.DataSelection"] = true; dojo.provide("dojox.grid.DataSelection"); dojo.require("dojox.grid.Selection"); dojo.declare("dojox.grid.DataSelection", dojox.grid.Selection, { getFirstSelected: function(){ var idx = dojox.grid.Selection.prototype.getFirstSelected.call(this); if(idx == -1){ return null; } return this.grid.getItem(idx); }, getNextSelected: function(inPrev){ var old_idx = this.grid.getItemIndex(inPrev); var idx = dojox.grid.Selection.prototype.getNextSelected.call(this, old_idx); if(idx == -1){ return null; } return this.grid.getItem(idx); }, getSelected: function(){ var result = []; for(var i=0, l=this.selected.length; i