Skip to Content
Menu
This question has been flagged
1 Reply
3291 Views

Hi,
I have used the following code to close the popup I have defined.

var PosBaseWidget = require('point_of_sale.BaseWidget');
var CustomWidget = PosBaseWidget.extend({
    template: 'CustomWidget',
    events: {
    'click .button.confirm': 'click_confirm',
    },    click_confirm: function(){
    var self = this;
        this.gui.close_popup();
        }});

But it raise an error as follows:
Uncaught TypeError: this.current_popup.close is not a function
How to fix this

Avatar
Discard
Best Answer

Hi,
Instead of using the PosBaseWidget use ScreenWidget as follows:

var ScreenWidget = require('point_of_sale.screens').ScreenWidget;
var OutOfStockWidget = ScreenWidget.extend({
template: 'OutOfStockWidget',
events: {
'click .button.confirm': 'click_confirm',
},
click_confirm: function(){
var self = this;
this.gui.close_popup();
}
});

Regards

Avatar
Discard