Im trying to add a custom widget similar to UsernameWidget
My widget in chrome.js
var SearchCustomerWidget = PosBaseWidget.extend({
template: 'SearchCustomerWidget',
init: function(parent, options){
options = options || {};
this._super(parent,options);
},
renderElement: function(){
var self = this;
this._super();
}
});
var Chrome = PosBaseWidget.extend({
widgets: [{
'name': 'customer-searchbox',
'widget': SearchCustomerWidget ,
'replace': '.placeholder-SearchCustomerWidget ',
}, ],
});
My custom file: I have tried like this but am not getting any result but no errors
var chrome = require('point_of_sale.chrome');
var PosBaseWidget = require('point_of_sale.BaseWidget');
chrome.Chrome.include({
template: 'Chrome',
widgets: [{
'name': 'customer-searchbox',
'widget': 'SearchCustomerWidget,
'replace': '.placeholder-SearchCustomerWidget',
}],
});
var SearchCustomerWidget = PosBaseWidget.extend({
template: 'SearchCustomerWidget',
init: function(parent, options){
options = options || {};
this._super(parent,options);
},
renderElement: function(){
var self = this;
});
return {
SearchCustomerWidget : SearchCustomerWidget,
}
Can anyone please help me to resolve this.
What exactly do you want to resolve, what's the problem?
I have customized new widget "SearchCustomerWidget " in file chrome.js , i want to make a custom module for this widget. please check my edited post