/*
	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
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.grid.enhanced.plugins.GridSource"],["require","dojo.dnd.Source"],["require","dojox.grid.enhanced.plugins.DnD"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.grid.enhanced.plugins.GridSource"]){_4._hasResource["dojox.grid.enhanced.plugins.GridSource"]=true;_4.provide("dojox.grid.enhanced.plugins.GridSource");_4.require("dojo.dnd.Source");_4.require("dojox.grid.enhanced.plugins.DnD");(function(){var _7=function(_8){var a=_8[0];for(var i=1;i<_8.length;++i){a=a.concat(_8[i]);}return a;};_4.declare("dojox.grid.enhanced.plugins.GridSource",_4.dnd.Source,{accept:["grid/cells","grid/rows","grid/cols","text"],insertNodesForGrid:false,markupFactory:function(_9,_a){return new _6.grid.enhanced.plugins.GridSource(_a,_9);},checkAcceptance:function(_b,_c){if(_b instanceof _6.grid.enhanced.plugins.GridDnDSource){if(_c[0]){var _d=_b.getItem(_c[0].id);if(_d&&(_4.indexOf(_d.type,"grid/rows")>=0||_4.indexOf(_d.type,"grid/cells")>=0)&&!_b.dndPlugin._allDnDItemsLoaded()){return false;}}this.sourcePlugin=_b.dndPlugin;}return this.inherited(arguments);},onDraggingOver:function(){if(this.sourcePlugin){this.sourcePlugin._isSource=true;}},onDraggingOut:function(){if(this.sourcePlugin){this.sourcePlugin._isSource=false;}},onDropExternal:function(_e,_f,_10){if(_e instanceof _6.grid.enhanced.plugins.GridDnDSource){var _11=_4.map(_f,function(_12){return _e.getItem(_12.id).data;});var _13=_e.getItem(_f[0].id);var _14=_13.dndPlugin.grid;var _15=_13.type[0];var _16;try{switch(_15){case "grid/cells":_f[0].innerHTML=this.getCellContent(_14,_11[0].min,_11[0].max)||"";this.onDropGridCells(_14,_11[0].min,_11[0].max);break;case "grid/rows":_16=_7(_11);_f[0].innerHTML=this.getRowContent(_14,_16)||"";this.onDropGridRows(_14,_16);break;case "grid/cols":_16=_7(_11);_f[0].innerHTML=this.getColumnContent(_14,_16)||"";this.onDropGridColumns(_14,_16);break;}if(this.insertNodesForGrid){this.selectNone();this.insertNodes(true,[_f[0]],this.before,this.current);}_13.dndPlugin.onDragOut(!_10);}catch(e){console.warn("GridSource.onDropExternal() error:",e);}}else{this.inherited(arguments);}},getCellContent:function(_17,_18,_19){},getRowContent:function(_1a,_1b){},getColumnContent:function(_1c,_1d){},onDropGridCells:function(_1e,_1f,_20){},onDropGridRows:function(_21,_22){},onDropGridColumns:function(_23,_24){}});})();}}};});