There's probably some additional configuration you need to do if this is similar to ExtJS. Search ExtJS forums and you'll find something.

PHP Code:

fieldLabel: 'First Name',
id: 'firstname',
name: 'FirstName',

//use autoCreate so the maxlength setting for form textfield and
//numberfield components respected on onkeyup/onkeydown, rather
//than just when the form is submitted.
autoCreate : {
tag : 'input',
type : 'text',
name : 'FirstName',
//if don't specify this in autoCreate then just specifies size="6"
maxlength : 6
},