Bonjour à tous,

Je me retrouve avec un undefined variable des plus mystiques. Tout d'abord, voici le code :

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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
$('a#interlocuteurs_id_unique').click( function() {
	
	var $modal = $('#editor-modal'),
	$editor = $('#editor'),
	$editorTitle = $('#editor-title'),
	//ft = FooTable.init('#editing-example', {
	ft = $("#interlocuteur_table").footable({
		columns: $.get('interlocuteur_table/columns.json'),
		rows: $.ajax({
			url :'interlocuteur_table/server_side_interlocuteur.php', 
			dataType: 'json',
			success: function(){
			}
		}),
		paging: {
			limit: 5,
			size: 10
		},
		editing: {
			"addText": "Ajouter un nouvel interlocuteur",
			enabled: true,
			addRow: function(){
				$modal.removeData('row');
				$editor[0].reset();
				$editorTitle.text('Ajouter un nouvel interlocuteur');
				$modal.modal('show');
			},
			editRow: function(row){
				var values = row.val();
				$editor.find('#nom').val(values.I_NOM);
				$editor.find('#prenom').val(values.I_PRENOM);
				$editor.find('#telephone').val(values.I_TEL1);
				$editor.find('#portable').val(values.I_TEL3);
				$editor.find('#email').val(values.I_EMAIL);
				$editor.find('#fonction').val(values.I_ADRESSE4);
				$editor.find('#code').val(values.I_CODE);
				$modal.data('row', row);
				$editorTitle.text('Modifier ' + values.I_PRENOM + ' ' + values.I_NOM);
				$modal.modal('show');
				},
			deleteRow: function(row){
				var values = row.val();
				$.ajax({
					url: 'interlocuteur_table/delete_in_bdd.php',
					dataType: 'json',
					data: { code: values['I_CODE'] },
					success: function(data) {
						if (data.statut == 'OK') {
							if (confirm('Voulez-vous vraiment supprimer cet interlocuteur?')){
								row.delete();
								$("#delete_interlocuteur").html(data.message).show();
							}
						} else
							$("#delete_interlocuteur_fail").html(data.message).show();
					}
				});
				// mettre I_EMAIL dans I_COMMENTAIRE
				
			}
		}
	}).data("__FooTable__");
	
	//uid = 10;
	$editor.on('submit', function(e){
		if (this.checkValidity && !this.checkValidity()) 
			return;
		e.preventDefault();
		
		var row = $modal.data('row'),
			values = {
				I_TITRE: $editor.find('#interlocuteur_titre_id').val(),
				I_NOM: $editor.find('#nom').val(),
				I_PRENOM: $editor.find('#prenom').val(),
				I_TEL1: $editor.find('#telephone').val(),
				I_TEL3: $editor.find('#portable').val(),
				I_EMAIL: $editor.find('#email').val(),
				I_ADRESSE4: $editor.find('#fonction').val(),
				I_CODE: $editor.find('#code').val()
			};

		if (row instanceof FooTable.Row){
		// edit
			$.ajax({
				url: 'interlocuteur_table/update_in_bdd.php',
				dataType: 'json',
				data: { nom: values['I_NOM'], prenom: values['I_PRENOM'], telephone: values['I_TEL1'], portable: values['I_TEL3'], email: values['I_EMAIL'], fonction: values['I_ADRESSE4'], code: values['I_CODE']},
				success: function(data) {
					if (data.statut == 'OK'){
						$("#edit_interlocuteur").html(data.message).show();
					}else 
						$("#edit_interlocuteur_fail").html(data.message).show();
				}
			});
			row.val(values);
			
		} else {
			// add
			$.ajax({
				url: 'interlocuteur_table/insert_in_bdd.php',
				dataType: 'json',
				
				data: { titre: values['I_TITRE'], nom: values['I_NOM'], prenom: values['I_PRENOM'], telephone: values['I_TEL1'], portable: values['I_TEL3'], email: values['I_EMAIL'], fonction: values['I_ADRESSE4'] }
				/*success : function(data) {
					if (data.statut == 'OK')
						$("#ajout_interlocuteur").html(data.message).show();
					else
						$("ajout_interlocuteur_fail").html(data.message).show();
				}*/
			});
			$modal.modal('hide');
			ft.rows.add(values);
		}
		$modal.modal('hide');
	});
		$('.footable-edit').hide();
	$('.footable-delete').hide();

});
Vous y verrez trois couleurs dans le code.

Le code en rouge, est la ou est mon undefined variable.

Celui en vert, c'est le cas ou j'ai cette erreur, et en bleu, je ne l'ai plus. Du coup, si quelqu'un avait une explication à me fournir...

Merci en tout cas de m'avoir lu !