-
12 Nov 2012 2:30 AM #1
[solved]How to load data from store to FormPanel?
[solved]How to load data from store to FormPanel?
I have a form.Panel in which I show some data. I receive the data as XML from the server and load it directly into the fields using
podform.getForm().load({url:url_servlet+'kadastr_zemform.jsp' ... along with a XMLReader.
Now I want to show the data in 3 separate form.Panel. But I just wan't to load the data once before loading it into panels. I guess form.load() no longer works for me in that case.
How would I load the data into several panels? Should I use a store cause I also need to be able to edit the data and send it back?
-
12 Nov 2012 3:09 AM #2
Hi maxkliver,
If you want to display data into three separate formPanel, for this purpose create a single store and use setValues() method of the form like -
For more detail read API docs-http://docs.sencha.com/ext-js/3-4/#!...thod-setValuesCode:var formData = Ext.data.Store(.........); yourFormPanel.setValues(formData);
sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
13 Nov 2012 12:58 AM #3
I get error:
TypeError: podform.setValues is not a function
And in FormPanel API i dont see a setValue() function. Whats wrong?
UPDATE
My bad right syntax is formPanle.getForm().setValues();
But anyway its not work with store. Someone can give me example?
-
14 Nov 2012 6:10 PM #4
var record = store.getAt(rowIndex);
formPanel.getForm().loadRecord(record);
-
15 Nov 2012 8:51 PM #5
Its work.Code:var record = store.getAt(rowIndex); formPanel.getForm().loadRecord(record);
What do you think about this?
Whats more correctly?Code:podform.getForm().setValues(store.getRange(0)[0].data);
But i have a problem. Its works only if i have some alerts before this line. How to use setValuers after store was loaded?
-
15 Nov 2012 11:30 PM #6
write the code in store load listener.
store.on('load',function(){
//xxxxx
});
-
16 Nov 2012 12:57 AM #7


Reply With Quote