How to use the devextreme/events.one function in devextreme

To help you get started, we’ve selected a few devextreme examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DevExpress / devextreme-react / src / core / template-wrapper.ts View on Github external
private _subscribeOnElementRemoval(element: Element): void {
        events.off(element, DX_REMOVE_EVENT, this._onDxRemove);
        events.one(element, DX_REMOVE_EVENT, this._onDxRemove);
    }
github DevExpress / devextreme-angular / src / core / template.ts View on Github external
childView.rootNodes.forEach((element) => {
            if (element.nodeType === 1) {
                this.renderer.addClass(element, DX_TEMPLATE_WRAPPER_CLASS);
            }

            events.one(element, 'dxremove', ({}, params) => {
                if (!params || !params._angularIntegration) {
                    childView.destroy();
                }
            });
        });
github DevExpress / devextreme-vue / src / core / templates-manager.ts View on Github external
name,
                    placeholder
                );

                const element = mountedTemplate.$el;
                if (element.classList) {
                    element.classList.add(DX_TEMPLATE_WRAPPER_CLASS);
                }

                if (element.nodeType === Node.TEXT_NODE) {
                    const removalListener = document.createElement(container.nodeName === "TABLE" ? "tbody" : "span");
                    removalListener.style.display = "none";
                    container.appendChild(removalListener);
                    events.one(removalListener, DX_REMOVE_EVENT, mountedTemplate.$destroy.bind(mountedTemplate));
                } else {
                    events.one(element, DX_REMOVE_EVENT, mountedTemplate.$destroy.bind(mountedTemplate));
                }

                return element;
            }
        };
github DevExpress / devextreme-vue / src / core / templates-manager.ts View on Github external
this._component,
                    scopeData,
                    name,
                    placeholder
                );

                const element = mountedTemplate.$el;
                if (element.classList) {
                    element.classList.add(DX_TEMPLATE_WRAPPER_CLASS);
                }

                if (element.nodeType === Node.TEXT_NODE) {
                    const removalListener = document.createElement(container.nodeName === "TABLE" ? "tbody" : "span");
                    removalListener.style.display = "none";
                    container.appendChild(removalListener);
                    events.one(removalListener, DX_REMOVE_EVENT, mountedTemplate.$destroy.bind(mountedTemplate));
                } else {
                    events.one(element, DX_REMOVE_EVENT, mountedTemplate.$destroy.bind(mountedTemplate));
                }

                return element;
            }
        };