PDA

View Full Version : Store with 2 Readers?



raj_plays
22 Feb 2011, 11:59 AM
Hi,
Please help me with a design consideration.
The XML returned from my server looks like..

<NewDataSet>
<Table>
<name>Second QRT camp</name>
<day_id>Sunday</day_id>
<duration>50</duration>
</Table>
<Table>
<name>Second QRT camp</name>
<day_id>Sunday</day_id>
<duration>12</duration>
</Table>
<Table>
<name>Second QRT camp</name>
<day_id>Wednesday</day_id>
<duration>14</duration>
</Table>
<Table1>
<day_id>Sunday</day_id>
<day_total>62</day_total>
</Table1>
<Table1>
<day_id>Wednesday</day_id>
<day_total>14</day_total>
</Table1>
</NewDataSet>

I want to perform calculations that require the "duration" values from "Table" and "day_total" values from "Table1" for each record of "Table" and "Table1".
Can that be possible with just 1 store config?
Declaring 2 stores will mean making 2 server requests which is redundant and then I will have to listen for 'load' events of both stores before I can perform the calculations which I don't know how to do.

Condor
23 Feb 2011, 6:11 AM
Do you actually need a store? Would a simple Ext.Ajax.request with some Ext.DomQuery calls to extract the data not also do?

If you really want to load a store with this then there are several ways load it with this data, or you could load 2 stores with the response from a single server request. They choice is yours...