-
15 Jun 2009 11:58 PM #1
How type of data must I put in my store? (array doesn't works, ArrayReader either)
How type of data must I put in my store? (array doesn't works, ArrayReader either)
Hello,
I've a problem with using a static store. I must use it for my fields, which are from different types. At first, I've my fields config files filled with all parameters (I cannot do it otherwise for some reasons), and then, I put the data of the store. I tried it:- With dataArray an array of type {'data': ['test', 'test2']}: Code:
field.store.loadData(dataArray)
- With dataArray an array of type ['test', 'test2']: Code:
field.store.data = dataArray
- With dataArray an array of type {'data': ['test', 'test2']}: Code:
var arrayReader = new Ext.data.ArrayReader({root: 'data', recordType: 'array'});
But no solution works. In the 1st solution, the result of the load of the data is simply invisible, in the 2nd solution, the error I have is "data.each is not a function" (I have compared my store with a working one, and effectively, in the data of the second, it has a "each" function, and many others, while the first contains only one function, "remove"). Lastly, with the 3rd solution, I get the error that "this.recordType is not defined".Code:field.store.data = (arrayReader.readRecords(dataArray));
Does someone has an idea of what must I use to fill my store's data?
Thank you.
- With dataArray an array of type {'data': ['test', 'test2']}:
-
16 Jun 2009 12:05 AM #2
But that's not an Array though is it? It's an object.With dataArray an array of type {'data': ['test', 'test2']}
This is an Array:
Code:[['test', 'test2'],['row2 test', 'row2 test2']]
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
16 Jun 2009 12:40 AM #3
Thank you for your answer, but when I use this type of array with the loadData method of the store, I've a "root is undefined" error, while when I use the object, I get no error, but the result is invisible.
-
16 Jun 2009 1:02 AM #4
Please, it has been two days since I try to resolve this issue... I specify that I add the field to its container (a fieldset) after the load of its store, and that I do a doLayout on the fieldset after it.
-
16 Jun 2009 1:11 AM #5
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642


Reply With Quote