|
43 |
"dojo/aspect", |
43 |
"dojo/aspect", |
44 |
"dojo/on", |
44 |
"dojo/on", |
45 |
"dojo/window", |
45 |
"dojo/window", |
46 |
"dijit/Destroyable", |
|
|
47 |
"dijit/Menu", |
46 |
"dijit/Menu", |
48 |
"dijit/MenuItem", |
47 |
"dijit/MenuItem", |
49 |
"dijit/form/DropDownButton", |
48 |
"dijit/form/DropDownButton", |
|
64 |
"../render", |
63 |
"../render", |
65 |
"../i18n!" |
64 |
"../i18n!" |
66 |
], function(declare, lang, array, kernel, win, construct, attr, geometry, style, domClass, |
65 |
], function(declare, lang, array, kernel, win, construct, attr, geometry, style, domClass, |
67 |
topic, aspect, on, dojoWindow, Destroyable, Menu, MenuItem, DropDownButton, entities, |
66 |
topic, aspect, on, dojoWindow, Menu, MenuItem, DropDownButton, entities, |
68 |
OnDemandGrid, Selection, DijitRegistry, Selector, StoreAdapter, Memory, Button, Text, ContainerWidget, |
67 |
OnDemandGrid, Selection, DijitRegistry, Selector, StoreAdapter, Memory, Button, Text, ContainerWidget, |
69 |
StandbyMixin, Tooltip, _RegisterOnShowMixin, tools, render, _) { |
68 |
StandbyMixin, Tooltip, _RegisterOnShowMixin, tools, render, _) { |
70 |
|
69 |
|
71 |
var _Grid = declare([OnDemandGrid, Selection, Selector, DijitRegistry, Destroyable], { |
70 |
var _Grid = declare([OnDemandGrid, Selection, Selector, DijitRegistry], { |
72 |
getItem: function(item) { |
71 |
getItem: function(item) { |
73 |
// For legacy dojox grid compability |
72 |
// For legacy dojox grid compability |
74 |
// e.g. formaters that expect to be working with a dojox grid |
73 |
// e.g. formaters that expect to be working with a dojox grid |
|
409 |
// register event handler |
408 |
// register event handler |
410 |
// |
409 |
// |
411 |
|
410 |
|
412 |
this._grid.on('dgrid-select', lang.hitch(this, '_selectionChanged', true)); |
411 |
this.own(this._grid.on('dgrid-select', lang.hitch(this, '_selectionChanged', true))); |
413 |
this._grid.on('dgrid-deselect', lang.hitch(this, '_selectionChanged', false)); |
412 |
this.own(this._grid.on('dgrid-deselect', lang.hitch(this, '_selectionChanged', false))); |
414 |
|
413 |
|
415 |
this._grid.on(".dgrid-row:contextmenu", lang.hitch(this, '_updateContextItem')); |
414 |
this.own(this._grid.on(".dgrid-row:contextmenu", lang.hitch(this, '_updateContextItem'))); |
416 |
|
415 |
|
417 |
this.on('filterDone', lang.hitch(this, '_updateGlobalCanExecute')); |
416 |
this.own(this.on('filterDone', lang.hitch(this, '_updateGlobalCanExecute'))); |
418 |
|
417 |
|
419 |
this._grid.on('dgrid-refresh-complete', lang.hitch(this, '_cleanupWidgets')); |
418 |
this.own(this._grid.on('dgrid-refresh-complete', lang.hitch(this, '_cleanupWidgets'))); |
420 |
|
419 |
|
421 |
aspect.after(this._grid, '_updateHeaderCheckboxes', lang.hitch(this, '_updateHeaderSelectClass')); |
420 |
this.own(aspect.after(this._grid, '_updateHeaderCheckboxes', lang.hitch(this, '_updateHeaderSelectClass'))); |
422 |
aspect.before(this._grid, '_updateHeaderCheckboxes', lang.hitch(this, '_updateAllSelectedStatus')); |
421 |
this.own(aspect.before(this._grid, '_updateHeaderCheckboxes', lang.hitch(this, '_updateAllSelectedStatus'))); |
423 |
|
422 |
|
424 |
if (this.query) { |
423 |
if (this.query) { |
425 |
this.filter(this.query); |
424 |
this.filter(this.query); |
|
558 |
}); |
557 |
}); |
559 |
} |
558 |
} |
560 |
this.own(container); |
559 |
this.own(container); |
561 |
container.on('click', lang.hitch(this, function() { |
560 |
this.own(container.on('click', lang.hitch(this, function() { |
562 |
var idProperty = this.moduleStore.idProperty; |
561 |
var idProperty = this.moduleStore.idProperty; |
563 |
defaultAction.callback([item[idProperty]], [item]); |
562 |
defaultAction.callback([item[idProperty]], [item]); |
564 |
})); |
563 |
}))); |
565 |
return container.domNode; |
564 |
return container.domNode; |
566 |
}); |
565 |
}); |
567 |
} |
566 |
} |
|
781 |
// add buttons to toolbar |
780 |
// add buttons to toolbar |
782 |
array.forEach(buttons.$order$, function(ibutton) { |
781 |
array.forEach(buttons.$order$, function(ibutton) { |
783 |
this._toolbar.addChild(ibutton); |
782 |
this._toolbar.addChild(ibutton); |
784 |
ibutton.on('click', lang.hitch(this, function() { |
783 |
this._toolbar.own(ibutton.on('click', lang.hitch(this, function() { |
785 |
this._publishAction(ibutton.name); |
784 |
this._publishAction(ibutton.name); |
786 |
})); |
785 |
}))); |
787 |
}, this); |
786 |
}, this); |
788 |
}, |
787 |
}, |
789 |
|
788 |
|