In Chapter 5, Working with Data, we saw
Stores working with Models and Fields. These are then bound to data-bound controls. A grid column, for example, used a DataIndex
property to associate a column with a Store's Fields. With a form, the Name
can serve the same purpose. With a grid, it automatically loaded the store's records into the grid for you. But you can also reuse a store with a form, with a small manual step to load a record into a form. This means you can achieve this kind of UI if you want:
To create the above, we first create a store, as we have seen in many previous examples:
<ext:Store ID="Store1" runat="server" OnReadData="FetchRecord" PageSize="1">
<Proxy>
<ext:PageProxy />
</Proxy>
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="ID" />
<ext:ModelField Name="Company" />
<ext:ModelField Name="Price" Type="Float" /...