Assign a value to a variable with DataStore fields value <p>I need to declare a variable TeacherName that will receive its value from the DataStore field 'NameT'</p> <pre><code>var storeTeacher = new Ext.data.JsonStore({ id: 'IDstoreTeacher', url: 'teacher.php', method: 'POST', baseParams:{task: "TEACHERNAME", parametar: idTeacher}, root: 'rows', fields: [{name: 'NameT', type: 'string', mapping: 'teacher_name'}], autoLoad: true }); var TeacherName = NameT; </code></pre> <p>But in Firebug I always get the following error message: "Uncaught ReferenceError: NameT is not defined"</p>