How to use the @hpcc-js/form.Button.prototype function in @hpcc-js/form

To help you get started, we’ve selected a few @hpcc-js/form 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 hpcc-systems / Visualization / packages / marshaller / src / ddl1 / FlyoutButton.ts View on Github external
render(callback?): this {
        const context = this;
        const isVisible = this._popup.popupState();
        Button.prototype.render.call(context, function (widget) {
            const popupParentWidgetBBox = context._popupParentWidget.getBBox();
            const bbox = widget.getBBox();
            context._popup
                .left(bbox.x - popupParentWidgetBBox.x + bbox.width - context._popup.width())
                .top(bbox.y - popupParentWidgetBBox.y + bbox.height)
                .visible(isVisible && context.autoClose() ? false : isVisible)  //  hack:  closes the form when submit is clicked  ---
                .popupState(isVisible && context.autoClose() ? false : isVisible)
                .render()
                ;
            if (callback) {
                callback(widget);
            }
        });
        return this;
    }