PDA

View Full Version : Getting "Uncaught RangeError: Maximum call stack size exceeded" when using setText



Spiff1
24 Oct 2013, 1:51 AM
Hi,

want to change (set) the text of a label of a form.
I added the listener "afterLayout" to the form and perform the following function:

Ext.ComponentQuery.query('label[itemId=myId1]')[0].setText('Test');

When doing it this way i get the error message
"Uncaught RangeError: Maximum call stack size exceeded"

Nevertheless i can see the new text in the form.

When changing a textfield this way:

Ext.ComponentQuery.query('textfield[itemId=myId2]')[0].setValue('Test');

i get no error.
Don't know why i get an error when changing the label text but no error with the textfield.

Spiff1

evant
24 Oct 2013, 2:06 AM
Because changing the label triggers a layout! The field needs to lay itself out again.

Spiff1
24 Oct 2013, 2:19 AM
Hi evant,

thank you for the quick answer.
Would it be the easiest way to use a textfield instead of the label or is there another way to use the label?

Spiff1