PDA

View Full Version : Open a Form for a particular id



duderion
29 Mar 2012, 3:51 AM
hi guys,

im pretty new to extjs, and i have a small problem:

i'd like to implement a 'edit user' form in a window-based layout and i have to tell the form, which id it should use to get the userdata via ajax. i'm not sure how to accomplish this, but i guess its easy :P

greets
dude

mitchellsimoens
29 Mar 2012, 7:47 AM
I would have a Model definition for a user. Then use the load method on the model to load the data via a user id. On success callback use loadRecord passing in the model that was created on the form.

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.Model-static-method-load
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.Panel-method-loadRecord