Hello Synfusion Team,
We are using synfusion grid. And we have defined a custom pop up for that named "Custom View" in toolbar of the grid. But the pop is not getting properly aligned to the icon. Is there any control with which we can achieve the requirement?
We have used mat-menu for this pop-up.
|
[app.component.ts]
clickHandler(args: ClickEventArgs): void {
if (args.item.id === 'Click') {
var target = document.getElementById('Click').closest('.e-toolbar-item');
// get the target element position details
var elempos = target.getBoundingClientRect();
// customize the position of popup based on the target element position
this.dialog.element.style.left = elempos.x + 'px';
this.dialog.element.style.top = elempos.height + elempos.y + 'px';
// show the dialog
this.dialog.show();
}
}
|
Thank you, Team. The solution worked
However, I tried to replicate the same for the column chooser. But it's not opening at the same place of the toolbar.
i tried with
this.grid.openColumnChooser(top, left); but the position still not the same. Is there any other way to do this.
|
[app.component.ts]
clickHandler(args: ClickEventArgs): void {
---
if (args.item.id === 'column-chooser') {
var target = document.getElementById('column-chooser').closest('.e-toolbar-item');
var elempos = target.getBoundingClientRect();
var left = elempos.x;
var top = elempos.height; // get the top value
this.grid.openColumnChooser(left, top);
}
}
|
Thank you Rajapandiyan and Synfusion Team for helping.