Bonjour,
J'ai un problème d'objets avec jquery.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
	this.getNext = function(){
		this.getStep(stepCourant+1);
	}
	this.getBack = function(){
		this.getStep(stepCourant-1);
	}
 
	//Defaut
	this.getStep(0);
 
	/*
	 * Action button
	 */
	$(DomButton.Back).click(function (){
		this.getBack();
	});
	$(DomButton.Next).click(function (){
		this.getNext();
	});
le mot clé this dans la fonction click() de jquery n'est pas le même que pour l'ensemble de ma class.
Comment puige faire pour faire passer mon obj courant (this) dans l'obj click.

donc j'ai fait ceci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
	this.getNext = function(){
		this.getStep(stepCourant+1);
	}
	this.getBack = function(){
		this.getStep(stepCourant-1);
	}
 
	//Defaut
	this.getStep(0);
 
	/*
	 * Action button
	 */
	var o = this;
	$(DomButton.Back).click(function (){
		o.getBack();
	});
	$(DomButton.Next).click(function (){
		o.getNext();
	});
	$(DomButton.Submit).click(function (){
		alert("Vous êtes arrivée a al fin du formulaire :)")
	});
la cela fonction mais es qu'il aurait une manière plus propre ou plus optimiser vue que javascript est obliger de doublé mon obj en mémoire