-
16 Sep 2010 8:43 AM #1
Load data into a Form from a Datastore?
Load data into a Form from a Datastore?
How to load data into a Form from a datastore?
I have a datastore, a model and form, i've tried to look at the examples but no one is related to datastore.
An example would be appreciated, thanks...
-
16 Sep 2010 9:48 AM #2
What is the problem?
Retrieve a record from your store and pass it to form.load() method.
http://dev.sencha.com/deploy/touch/d...el&member=load
Just make sure that the form field names match the names of your model fields.Eugene
Ext.Direct for ASP.NET MVC
-
16 Sep 2010 10:06 AM #3
Thanks, but the point is that i don't know the syntax to do that, assuming my model is called Profile and the datastore ProfileStore,the datastore is loaded according then Profile Model and then?
form.load(of what?), i'm missing the point...
-
16 Sep 2010 10:09 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
Having a store just to load data into a form seems wasteful to me.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
16 Sep 2010 10:12 AM #5
Eugene
Ext.Direct for ASP.NET MVC
-
16 Sep 2010 10:21 AM #6
Yes, thanks a lot, exactly what i need, i know that this can be achieved by doing an Ajax request in this form:
but i like more datastore way...Code:var profiledata = Ext.ModelMgr.create(AjaxResponse, 'profile'); this.profileForm.load(profiledata);
-
17 Sep 2010 9:48 AM #7
I solved in this way:
Code:var profile = Ext.regModel('profile',{ fields: [ { name: 'username', type: 'string' }, { name: 'alias', type: 'string' }, { name: 'sex', type: 'string' }, { name: 'AgeRange_ageRangeId', type: 'string' } ] });Code:Ext.Ajax.request({ url: 'php/profile_load.php?username=' + formL.getValues().username, success: function(response, opts) { var responseObj=Ext.decode(response.responseText); if(responseObj.success){ try { console.log(responseObj.text.alias); } catch (e) { } var profiledata = Ext.ModelMgr.create(responseObj.text, 'profile'); formP.load(profiledata); } else { alert(responseObj.text); } }, failure:function(response, opts){ }, scope:this });
-
13 Feb 2013 3:44 PM #8
Question
Question
How to load a dynamic list (mysql/php) into combobox???

Similar Threads
-
[Solved] Load a ComboBox, Load a Datastore and set the combobox value with ds data
By pouniok in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 11 May 2009, 2:00 AM -
my DataStore dont load Data
By aityahia in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 24 Feb 2009, 12:26 PM -
How to load remote datastore of combobox when loading form?
By rukiyem in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 17 Jul 2008, 6:42 AM -
datastore load during form load
By mthad in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 8 Jul 2008, 7:26 AM -
Problem with Form response and getting DataStore data
By mrbse in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 17 Mar 2008, 9:53 AM


Reply With Quote