Hi,
I'm looking at the splitter documentation but I cannot seem to find an example or explanation on how I would do an interactive update on the panels.
Example: if having 3 panels left treeview , center a Grid and right a form with some text controls.
When clicking on the treeview the center should show the correct list, if clicked on the grid row the right panel should load the correct text in the textbox.
I found the mail demo but this is not showing how this would work if one clicks on the items.
Do you have an example that could help me out?
|
export class OutlookLayout extends SampleBase {
. . .
nodeClicked(args) {
if (args.node.getElementsByClassName('textcontent')[0].innerText) {
var gridObj = document.getElementsByClassName('e-grid')[0]
.ej2_instances[0];
gridObj.dataSource = gridObj.dataSource.slice(0, 5);
// likewise you can change Grid dataSource as per your needs.
}
}
rowSelected(args) {
document.getElementById('firstname').ej2_instances[0].value =
args.data.CustomerID;
}
. . .
content1() {
return (
<div className="splitter-content">
<TreeViewComponent
id="splitter-tree"
fields={this.treeFields}
nodeTemplate={this.nodeTemplate}
nodeClicked={this.nodeClicked.bind(this)}
/>
</div>
);
}
content2() {
return (
<div className="control-pane">
<div className="control-section">
<GridComponent
dataSource={data}
rowSelected={this.rowSelected.bind(this)}
height="350"
>
. . .
</GridComponent>
</div>
</div>
);
}
content3() {
return (
<div>
<div className="splitter-content">
<div style={{ width: '100%', padding: '15px' }}>
<table>
<tr>
<td id="firstname-target">
<h4>Grid data Displayed</h4>
<TextBoxComponent
id="firstname"
placeholder="Customer Name"
/>
</td>
</tr>
</table>
</div>
</div>
</div>
);
}
onSplitterResize() {
this.rteObj.refreshUI();
}
render() {
return (
<div id="target" className="control-section outlook-style">
<SplitterComponent
id="splitter1"
height="493px"
width="100%"
ref={splitter => {
this.splitterInstance = splitter;
}}
resizing={this.onSplitterResize.bind(this)}
>
<PanesDirective>
<PaneDirective
size={this.paneSize1}
min={this.minimumSize1}
content={this.content1.bind(this)}
/>
<PaneDirective
size={this.paneSize2}
min={this.minimumSize2}
content={this.content2.bind(this)}
/>
<PaneDirective
size={this.paneSize3}
min={this.minimumSize3}
content={this.content3.bind(this)}
/>
</PanesDirective>
</SplitterComponent>
</div>
);
}
} |