|
ngOnInit() {
const popHandler = (e) => {
console.dir(e);
console.log('browser history chanegd.')
};
window.addEventListener('popstate', popHandler, { once: true });
(DropDownList as any).prototype.onMouseClick = function (e) {
let target: Element = <Element>e.target;
let classList: DOMTokenList = target.classList;
let li: HTMLElement = <HTMLElement>closest(target, '.' + 'e-list-item');
if (!this.isValidLI(li)) {
return;
}
this.setSelection(li, e);
if (Browser.isDevice && this.isFilterLayout()) {
var delay = 100;
this.closePopup(delay);
} else {
let delay: number = 100;
this.closePopup(delay);
}
};
} |
|
onOpen(event) {
setTimeout(() => {
if (Browser.isDevice) {
var parentElement = (this.mulObj as any).overAllWrapper;
event.popup.position = { X: 'left', Y: 'bottom' };
event.popup.width = parentElement.offsetWidth;
event.popup.dataBind();
event.popup.element.classList.remove(
'e-ddl-device',
'e-popup-full-page'
);
event.popup.element.style.top =
parseInt(event.popup.element.style.top) +
parentElement.offsetHeight +
'px';
event.popup.element.style.bottom = 'auto';
event.popup.element.style.maxHeight = (this.mulObj as any).popupHeight;
event.popup.element.querySelector('.e-content').style.maxHeight =
parseInt((this.mulObj as any).popupHeight) - 35 + 'px';
event.popup.element.querySelector('.e-content').style.height =
'initial';
}
});
} |
|
<ejs-multiselect id='multiselect-checkbox' width="300px" [changeOnBlur]="changeOnBlur"
(open)="onOpen($event)" (change)="onChange($event)" #checkbox [dataSource]='countries'
[placeholder]='checkWaterMark' [fields]='checkFields' [mode]='mode' popupHeight='300px'
popupWidth='300px' [showDropDownIcon]='true' showSelectAll='true'
[filterBarPlaceholder]='filterPlaceholder'>
</ejs-multiselect> |
|
public changeOnBlur = false; |
Hi, how can I prevent popup event for syncfusion dropdowns in Vue? Can't figure out how to rewrite the example for Angular.
The open and close events will be triggered when the DropDownList popup opens and closes. You can prevent these events by setting the popup event arguments' cancel property to true. Please refer to the shared documentation below for more information.
Documentation:
I meant prevent a pop-state event triggered by popup. I don't need to prevent popup to open or close, but prevent it to trigger pop-state event. It's prevented in this reply but for Angular: https://www.syncfusion.com/forums/166214/allowfiltering-true-reloads-the-page-on-mobile-tabled-devices?reply=SEnp3t How can I do that in Vue?
Hi Dimitrije, ,
Thank you for reaching out to us with your query. We understand that you would like to prevent the triggering of the pop-state event in Vue, similar to the solution provided for Angular.
We have prepared a sample specifically for Vue that addresses your requirement. You can find the Vue sample in the attachment.
Regards,
Kokila Poovendran.
Yes, that works. Thank you!