Hi Tanner,
Greetings from Syncfusion support.
We have validated your query “When rendering the dialog inside the splitter, I want the dialog height and the width of the dialog same as the splitter even when resizing”.
This can be achieved by the following steps,
- First set the `target` property of the dialog to be the element inside the splitter pane.
- Then setting the `height` property of the dialog to be 100%.
- To change the dialog height dynamically, bind the `resizing` event of the splitter.
- The dialog `height` property can be set by calculating the height of the splitter pane in which the dialog is rendered.
- Then call the `refreshPosition` public method of the dialog to refresh the position properly inside the splitter.
We have also prepared a sample for your reference,
Code Snippet:
|
<div id="vertical">
<div class="splitter-default-content">
<span>Top pane <div id="panetext">size: 30%</div><div id="panetext">min: 60px</div></span>
</div>
<div class="splitter-default-content secondPane">
<div id="dialog"></div>
</div>
<div class="splitter-default-content">
<span>Bottom pane<div id="panetext">size: 30%</div><div id="panetext">min: 60px</div></span>
</div>
</div>
</div> |
|
let splitObj: Splitter = new Splitter({
. . .
orientation: "Vertical",
resizing: resizeEvent,
});
splitObj.appendTo("#vertical");
let dialog = new Dialog({
target: document.querySelector(".secondPane") as HTMLElement,
width: "100%",
height: "100%"
});
dialog.appendTo("#dialog"); |
|
function resizeEvent() {
var middlePaneSize = splitObj.element.querySelectorAll(".e-pane")[1].getBoundingClientRect().height;
dialog.height = middlePaneSize.toString() + "px";
dialog.refreshPosition();
} |
Please check the above code snippet and the sample and let us know if it satisfies your requirement.
Regards,
Revanth