summaryrefslogtreecommitdiff
path: root/js/dojo-1.6/dojox/grid/DataSelection.xd.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/dojo-1.6/dojox/grid/DataSelection.xd.js')
-rw-r--r--js/dojo-1.6/dojox/grid/DataSelection.xd.js81
1 files changed, 81 insertions, 0 deletions
diff --git a/js/dojo-1.6/dojox/grid/DataSelection.xd.js b/js/dojo-1.6/dojox/grid/DataSelection.xd.js
new file mode 100644
index 0000000..d82dac5
--- /dev/null
+++ b/js/dojo-1.6/dojox/grid/DataSelection.xd.js
@@ -0,0 +1,81 @@
+/*
+ Copyright (c) 2004-2011, 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.grid.DataSelection"],
+["require", "dojox.grid.Selection"]],
+defineResource: function(dojo, dijit, dojox){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<l; i++){
+ if(this.selected[i]){
+ result.push(this.grid.getItem(i));
+ }
+ }
+ return result;
+ },
+
+ addToSelection: function(inItemOrIndex){
+ if(this.mode == 'none'){ return; }
+ var idx = null;
+ if(typeof inItemOrIndex == "number" || typeof inItemOrIndex == "string"){
+ idx = inItemOrIndex;
+ }else{
+ idx = this.grid.getItemIndex(inItemOrIndex);
+ }
+ dojox.grid.Selection.prototype.addToSelection.call(this, idx);
+ },
+
+ deselect: function(inItemOrIndex){
+ if(this.mode == 'none'){ return; }
+ var idx = null;
+ if(typeof inItemOrIndex == "number" || typeof inItemOrIndex == "string"){
+ idx = inItemOrIndex;
+ }else{
+ idx = this.grid.getItemIndex(inItemOrIndex);
+ }
+ dojox.grid.Selection.prototype.deselect.call(this, idx);
+ },
+
+ deselectAll: function(inItemOrIndex){
+ var idx = null;
+ if(inItemOrIndex || typeof inItemOrIndex == "number"){
+ if(typeof inItemOrIndex == "number" || typeof inItemOrIndex == "string"){
+ idx = inItemOrIndex;
+ }else{
+ idx = this.grid.getItemIndex(inItemOrIndex);
+ }
+ dojox.grid.Selection.prototype.deselectAll.call(this, idx);
+ }else{
+ this.inherited(arguments);
+ }
+ }
+});
+
+}
+
+}};});