X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..2e847cf21b8ab9d15fa167b315ca5b2fa92638fc:/examples/ux/MultiSelect.js diff --git a/examples/ux/MultiSelect.js b/examples/ux/MultiSelect.js index 4ded37bf..d8e9d582 100644 --- a/examples/ux/MultiSelect.js +++ b/examples/ux/MultiSelect.js @@ -1,6 +1,6 @@ /*! - * Ext JS Library 3.0.0 - * Copyright(c) 2006-2009 Ext JS, LLC + * Ext JS Library 3.1.1 + * Copyright(c) 2006-2010 Ext JS, LLC * licensing@extjs.com * http://www.extjs.com/license */ @@ -18,7 +18,7 @@ Ext.ns('Ext.ux.form'); * @constructor * Create a new MultiSelect * @param {Object} config Configuration options - * @xtype multiselect + * @xtype multiselect */ Ext.ux.form.MultiSelect = Ext.extend(Ext.form.Field, { /** @@ -156,9 +156,9 @@ Ext.ux.form.MultiSelect = Ext.extend(Ext.form.Field, { height: this.height, width: this.width, style: "padding:0;", - tbar: this.tbar, - bodyStyle: 'overflow: auto;' + tbar: this.tbar }); + fs.body.addClass('ux-mselect'); this.view = new Ext.ListView({ multiSelect: true, @@ -351,7 +351,7 @@ Ext.extend(Ext.ux.form.MultiSelect.DragZone, Ext.dd.DragZone, { this.onStartDrag(x, y); return true; }, - + // private collectSelection: function(data) { data.repairXY = Ext.fly(this.view.getSelectedNodes()[0]).getXY(); @@ -440,9 +440,9 @@ Ext.ux.form.MultiSelect.DropZone = function(ms, config){ Ext.extend(Ext.ux.form.MultiSelect.DropZone, Ext.dd.DropZone, { /** - * Part of the Ext.dd.DropZone interface. If no target node is found, the - * whole Element becomes the target, and this causes the drop gesture to append. - */ + * Part of the Ext.dd.DropZone interface. If no target node is found, the + * whole Element becomes the target, and this causes the drop gesture to append. + */ getTargetFromEvent : function(e) { var target = e.getTarget(); return target; @@ -525,9 +525,14 @@ Ext.extend(Ext.ux.form.MultiSelect.DropZone, Ext.dd.DropZone, { var pt = this.getDropPoint(e, n, dd); if (n != this.ms.fs.body.dom) n = this.view.findItemFromChild(n); - var insertAt = (this.ms.appendOnly || (n == this.ms.fs.body.dom)) ? this.view.store.getCount() : this.view.indexOf(n); - if (pt == "below") { - insertAt++; + + if(this.ms.appendOnly) { + insertAt = this.view.store.getCount(); + } else { + insertAt = n == this.ms.fs.body.dom ? this.view.store.getCount() - 1 : this.view.indexOf(n); + if (pt == "below") { + insertAt++; + } } var dir = false;