ViewUtil - Infomaker/Dashboard-Plugin GitHub Wiki
Get a reference to the ViewUtil object
The Dashboard object exposes a ViewUtil class. You can access it like this:
const ViewUtil = Dashboard.ViewUtil
ViewUtil components
EnhanceWithClickOutside
<ViewUtil.EnhanceWithClickOutside handleClickOutside={(event) => {}} />
Attr |
Type |
Default |
Description |
handleClickOutside |
function |
null |
callback when a click outside is triggered |
Scrollable
class MyComponent extends Dashboard.Application {
render() {
return (
<ViewUtil.Scrollable>
...
</ViewUtil.Scrollable>
)
}
}
Portal
Attr |
Type |
Default |
Description |
children |
react elemnts |
null |
React elemnts to render them inside Portal |
domNode |
doomNode element |
null |
domNode element to render the children inside it |
reactJs Potals
Portal example
const ViewUtil = Dashboard.ViewUtil
class MyComponent extends Dashboard.Application {
render() {
return (
ViewUtil.Portal(
children,
domNode
)
)
}
}
QueryEventWrapper
<ViewUtil.QueryEventWrapper qsInstance={this.qsInstance} search={"query"} onStreamEvent={(event) => {}}>
<ChildComponent/>
</ViewUtil.QueryEventWrapper>
Deprecated
- <ViewUtil.QueryEventWrapper qsInstance={this.qsInstance} search={"query"}>
- <ChildComponent /> //child component need to implement the onStreamEvent function
- </ViewUtil.QueryEventWrapper>
Attr |
Type |
Default |
Description |
qsInstance |
object |
null |
a instance of LCC QueryStreamer object |
search |
string |
null |
a valid OC query to listen for events on |
onStreamEvent |
function |
null |
callback when a event has occurred |