-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgridMixin.js
33 lines (33 loc) · 1.09 KB
/
gridMixin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
define(["dojo/_base/lang","dojo/_base/declare", "dgrid/OnDemandGrid", "dojo/store/Memory","dojo/store/Observable","dijit/form/Button", "dojo/aspect","dojo/date","dgrid/editor", "put-selector/put", "dojo/on"],
function(lang,declare, OnDemandGrid, Memory,Observable,Button, aspect,date,editor, put, on){
var businessGrid = declare(null, {
constructor:function() {
var grid = this;
aspect.after(this, "renderHeader", function() {
grid.on('dgrid-refresh-complete',function(response) {
if(response && response.results && response.results.then) {
response.results.then(function(trs) {
if(trs.length > 0) {
on.emit(grid.domNode,'dgrid-datachange','')
} else {
on.emit(grid.domNode,'dgrid-noDataMessage', grid.noDataMessage)
}
})
}
})
});
},
_getRowIdToObject:function() {
return this._rowIdToObject
},
_getSelectedRowsData: function() {
var _selection = this.get('selection')
var _rows = [];
for(eachRowId in _selection) {
_rows.push(this.row(eachRowId).data)
}
return _rows;
}
});
return businessGrid;
});