var SortingTable = new Class({
initialize: function(table, options) {
this.table=$(table);
this.tbody = this.table.getElement('tbody');
//...do alot of things here...
},
addTextInput : function(index,headid,options){
var trs = this.tbody.getChildren();
var trslen = trs.length;
var i=0;
var cell = null;
for(i=0;i<trslen;i++){
cell = trs[i].getChildren()[index];
cell.addEvent('dblclick', function (event){
alert(this.innerHTML); // i can see this is the cell here.
this.makeCellEditor(this); // how to access the parent object?
});
}
},
makeCellEditor : function(cell){
//make form and stuff here.
}
//...alot of more functions...
});
В моей функции dblclick (event) я хотел бы получить доступ к моей функции makeCellEditor, которую я объявил в «родительском» объекте.Доступ к переменным и методам родительского объекта javascript?
Спасибо, что это сработало как очарование! – jonaz