-
Notifications
You must be signed in to change notification settings - Fork 1
/
sample-remove-initclass.ts
40 lines (35 loc) · 1.42 KB
/
sample-remove-initclass.ts
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
34
35
36
37
38
39
40
export default DatagridDisplayComponent = (function () {
DatagridDisplayComponent = class DatagridDisplayComponent extends AsyncLoadComponent {
static initClass() {
this.contextTypes = { apiUrl: PropTypes.string } // Legacy
this.propTypes = {
datagridId: PropTypes.string,
login: PropTypes.object, // Should contain user and client
share: PropTypes.string,
showControls: PropTypes.bool, // True to show datagrid controls
db: PropTypes.object, // Needed for row view popup
error: PropTypes.func, // Error handler
onRowClick: PropTypes.func, // Override default row click. Return true if handled, false if not
titleElem: PropTypes.node, // Optional title element
extraTitleButtonsElem: PropTypes.node, // Optional extra buttons
useDirectDataSource: PropTypes.bool, // True to use direct data source to prevent caching
apiUrl: PropTypes.string,
filters: PropTypes.arrayOf(
PropTypes.shape({
table: PropTypes.string.isRequired, // id table to filter
jsonql: PropTypes.object.isRequired // jsonql filter with {alias} for tableAlias
})
)
}
this.defaultProps = { showControls: true }
}
constructor(props: any) {
super(props)
this.state = {
datagrid: null
}
}
}
DatagridDisplayComponent.initClass()
return DatagridDisplayComponent
})()