Hi Folks, I'm pretty sure that I'm going to be told to go back to school here, but I've wasted a whole morning trying to figure this out - now it's time to ask the experts.
I've simplified my code here to demonstrate what I'm trying to do: [CODE] var buildPage = {}; buildPage = Class.create(); buildPage.prototype = { initialize: function() { this.rowTemplate = '<tr>...' this.rs = []; this._getData(); },// initialize _getData : function() {//using AJAX to grab a JSON array from the server and store it in this.rs }, _parseTemplate : function() {//write data to screen then add event listeners $$('.editable').invoke('observe', 'mouseover',function(e){e.element ().addClassName('pseudo-text-box')}); $$('.editable').invoke('observe', 'mouseout',function(e){e.element ().removeClassName('pseudo-text-box')}); $$('.editable').invoke('observe', 'click', function(e) {this._editField.bindAsEventListener(this, e) }); }, _editField : function(e) { //Inject <INPUT> field } }; [/CODE] My problem is with this line: $$('.editable').invoke('observe', 'click', function(e) {this._editField.bindAsEventListener(this, e) }); At runtime, I always get the message that this._editField is not a function, no matter how I try the binding. The only way I can get this to work is to initiate the class (var a = new buildPage) than call c._editField from within the function - but that's not much good when I come to re-use it. Can someone explain to me what's going on here - I'm stumped. Many thanks George --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---