|
33 |
"dojo/_base/lang", |
33 |
"dojo/_base/lang", |
34 |
"dojo/_base/array", |
34 |
"dojo/_base/array", |
35 |
"dojo/Deferred", |
35 |
"dojo/Deferred", |
36 |
"dojo/query", |
|
|
37 |
"dojo/dom-class", |
36 |
"dojo/dom-class", |
38 |
"dojox/grid/EnhancedGrid", |
37 |
"dojox/grid/EnhancedGrid", |
39 |
"../tools", |
38 |
"../tools", |
|
41 |
"./_FormWidgetMixin", |
40 |
"./_FormWidgetMixin", |
42 |
"./StandbyMixin", |
41 |
"./StandbyMixin", |
43 |
"./_RegisterOnShowMixin", |
42 |
"./_RegisterOnShowMixin", |
|
|
43 |
"umc/i18n!", |
44 |
"dojox/grid/enhanced/plugins/IndirectSelection", |
44 |
"dojox/grid/enhanced/plugins/IndirectSelection", |
45 |
"dojox/grid/cells" |
45 |
"dojox/grid/cells" |
46 |
], function(declare, lang, array, Deferred, query, domClass, EnhancedGrid, tools, _SelectMixin, _FormWidgetMixin, StandbyMixin, _RegisterOnShowMixin) { |
46 |
], function(declare, lang, array, Deferred, domClass, EnhancedGrid, tools, _SelectMixin, _FormWidgetMixin, StandbyMixin, _RegisterOnShowMixin, _) { |
47 |
return declare("umc.widgets.MultiSelect", [ EnhancedGrid, _FormWidgetMixin, _SelectMixin, StandbyMixin, _RegisterOnShowMixin ], { |
47 |
return declare("umc.widgets.MultiSelect", [ EnhancedGrid, _FormWidgetMixin, _SelectMixin, StandbyMixin, _RegisterOnShowMixin ], { |
48 |
// summary: |
48 |
// summary: |
49 |
// This class represents a MultiSelect widget. Essentially, it adapts a DataGrid |
49 |
// This class represents a MultiSelect widget. Essentially, it adapts a DataGrid |
|
74 |
// simple grid structure, only one column |
74 |
// simple grid structure, only one column |
75 |
structure: [{ |
75 |
structure: [{ |
76 |
field: 'label', |
76 |
field: 'label', |
77 |
name: 'Name', |
77 |
name: lang.replace('<b>{0}</b>', [_('Select all')]), |
78 |
width: '100%' |
78 |
width: '100%' |
79 |
}], |
79 |
}], |
80 |
|
80 |
|
|
99 |
postCreate: function() { |
99 |
postCreate: function() { |
100 |
this.inherited(arguments); |
100 |
this.inherited(arguments); |
101 |
|
101 |
|
102 |
// hide the header |
|
|
103 |
query('.dojoxGridHeader', this.domNode).style('height', '0px'); |
104 |
|
105 |
// send an onChange event when the selection has changed |
102 |
// send an onChange event when the selection has changed |
106 |
this.on('selectionChanged', lang.hitch(this, function() { |
103 |
this.on('selectionChanged', lang.hitch(this, function() { |
107 |
if (array.some(this.selection.getSelected(), function(v) { return v === null; })) { |
104 |
if (array.some(this.selection.getSelected(), function(v) { return v === null; })) { |
|
237 |
// stop standby animation and re-render |
234 |
// stop standby animation and re-render |
238 |
this.standby(false); |
235 |
this.standby(false); |
239 |
this.render(); |
236 |
this.render(); |
240 |
} |
237 |
}, |
241 |
|
238 |
|
242 |
/*adaptHeight: function() { |
239 |
/*adaptHeight: function() { |
243 |
this.inherited(arguments); |
240 |
this.inherited(arguments); |
|
247 |
this.scroller.windowHeight = parseInt(this.height, 10); |
244 |
this.scroller.windowHeight = parseInt(this.height, 10); |
248 |
} |
245 |
} |
249 |
}*/ |
246 |
}*/ |
|
|
247 |
|
248 |
render: function() { |
249 |
domClass.toggle(this.domNode, 'umcMultiSelectWithContent', this.get('rowCount')); |
250 |
this.inherited(arguments); |
251 |
} |
250 |
}); |
252 |
}); |
251 |
}); |
253 |
}); |
252 |
|
254 |
|