PDA

View Full Version : why this Ext.ComponentQuery.query('#parish')[0].reset(); complains reset() undefined?



phamtranquocviet
19 Jul 2013, 8:20 PM
Hi,

These simple lines of code throw an error, and I can't figure out why:

This line shows the found object:
console.log(Ext.ComponentQuery.query('#parish')[0]);
//Object { fieldLabel="Parish", name="parish", itemId="parish", more...}

However, this same ojbect throws the following error when I call reset() on it:
Ext.ComponentQuery.query('#parish')[0].reset();

//TypeError: Ext.ComponentQuery.query(...)[0].reset(...) is undefined

Please help. Thanks.

mankz
20 Jul 2013, 3:38 PM
What type of component is it you're targeting? Have you checked the API to make sure it actually has a reset method?