Commit 63bf2a02 by Torkel Ödegaard

grid: need to find a way to add angular component inside react

parent 6cd2624c
......@@ -2,6 +2,7 @@ import React from 'react';
import coreModule from 'app/core/core_module';
import ReactGridLayout from 'react-grid-layout';
import {DashboardModel} from '../model';
import {DashboardPanel} from './DashboardPanel';
import sizeMe from 'react-sizeme';
const COLUMN_COUNT = 24;
......@@ -68,14 +69,7 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
for (let panel of this.props.dashboard.panels) {
panelElements.push(
<div key={panel.id.toString()} className="panel">
<div className="panel-container">
<div className="panel-header grid-drag-handle">
<div className="panel-title-container">{panel.type}</div>
</div>
<div className="panel-content">
{panel.title} - {panel.type}
</div>
</div>
<DashboardPanel panel={panel} />
</div>,
);
}
......
import React from 'react';
export interface DashboardPanelProps {
panel: any;
}
export class DashboardPanel extends React.Component<DashboardPanelProps, any> {
private element: any;
constructor(props) {
super(props);
this.state = {};
}
componentDidMount() {
}
render() {
return (
<div ref={element => this.element = element} />
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment