{' + this.displayField + '}
';
-
- if(!this.store){
- this.store = new Ext.data.SimpleStore({
- fields: this.dataFields,
- data : this.data
- });
- }
-
- this.view = new Ext.ux.DDView({
- multiSelect: true,
- store: this.store,
- selectedClass: cls+"-selected",
- tpl:tpl,
- allowDup:this.allowDup,
- copy: this.copy,
- allowTrash: this.allowTrash,
- dragGroup: this.dragGroup,
- dropGroup: this.dropGroup,
- itemSelector:"."+cls+"-item",
- isFormField:false,
- applyTo:fs.body,
- appendOnly:this.appendOnly,
- sortField:this.sortField,
- sortDir:this.sortDir
- });
-
- fs.add(this.view);
-
- this.view.on('click', this.onViewClick, this);
- this.view.on('beforeClick', this.onViewBeforeClick, this);
- this.view.on('dblclick', this.onViewDblClick, this);
- this.view.on('drop', function(ddView, n, dd, e, data){
- return this.fireEvent("drop", ddView, n, dd, e, data);
- }, this);
-
- this.hiddenName = this.name;
- var hiddenTag={tag: "input", type: "hidden", value: "", name:this.name};
- if (this.isFormField) {
- this.hiddenField = this.el.createChild(hiddenTag);
- } else {
- this.hiddenField = Ext.get(document.body).createChild(hiddenTag);
- }
- fs.doLayout();
- },
-
- // private
- initValue:Ext.emptyFn,
-
- // private
- onViewClick: function(vw, index, node, e) {
- var arrayIndex = this.preClickSelections.indexOf(index);
- if (arrayIndex != -1)
- {
- this.preClickSelections.splice(arrayIndex, 1);
- this.view.clearSelections(true);
- this.view.select(this.preClickSelections);
- }
- this.fireEvent('change', this, this.getValue(), this.hiddenField.dom.value);
- this.hiddenField.dom.value = this.getValue();
- this.fireEvent('click', this, e);
- this.validate();
- },
-
- // private
- onViewBeforeClick: function(vw, index, node, e) {
- this.preClickSelections = this.view.getSelectedIndexes();
- if (this.disabled) {return false;}
- },
-
- // private
- onViewDblClick : function(vw, index, node, e) {
- return this.fireEvent('dblclick', vw, index, node, e);
- },
-
- /**
- * Returns an array of data values for the selected items in the list. The values will be separated
- * by {@link #delimiter}.
- * @return {Array} value An array of string data values
- */
- getValue: function(valueField){
- var returnArray = [];
- var selectionsArray = this.view.getSelectedIndexes();
- if (selectionsArray.length == 0) {return '';}
- for (var i=0; i