Mot clé this classe javascript
Bonjour,
Petite question toute bête.
Je crée une classe avec des méthodes :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
/**
* Classe Composant Bank
*
*/
var BankCpt = function(pCfg) {
this.cfg = pCfg;
// proxy
this.dataProxy = new Ext.data.HttpProxy({
url: this.cfg.baseURL + '/AxBank/get-list'
});
};
BankCpt.prototype.buildGrid = function() {
// ...... du code
// listeners
var listeners = {
celldblclick: function(pGrid, pRowIndex, pEvt) {
/*var record = pGrid.getStore().getAt(pRowIndex); // Get the Record
var data = record.get(fieldName);*/
this.getForm(pRowIndex);
}
}
//......code
};
BankCpt.prototype.getForm = function(pRowId) {
}; |
Sauf que le "this" de la ligne :
Code:
1 2
|
this.getForm(pRowIndex); |
Ne fait pas référence à l'instance en cours de BankCpt.
En dehors du listener aucun problème.
Comment faire ?
Merci :)
A+ benjamin.