I got the following script shortened :
var HTH = HTH || {};
(function() {
var assetGrouping = function() {
var self = this;
this.options = {
_tmpElement: '',
QuantityAssigned: 0,
qtyInputField: ''
};
this.init = function(options){
// ...
this.options.QuantityAssigned = 0;
jQuery(this.options.qtyInputField).bind('keyup', function(){
self._tmpElement = jQuery(this);
self.CalculateQuantityAssigned();
});
// ...
}
CalculateQuantityAssigned = function(){
// ...
}
}
HTH.assetGrouping = new assetGrouping();
})();
$(document).ready(function(){
HTH.assetGrouping.init({
qtyInputField: 'input[name^="at700_group_qty"]'
});
});
The error happen at the following line : self.CalculateQuantityAssigned(); and the error is Uncaught TypeError: Object [object Object] has no method 'CalculateQuantityAssigned'.
I don't understand. Using this will fail of course and self is working when I want to access self.options but not for self.CalculateQuantityAssigned().
Thanks.