PDA

View Full Version : [CLOSED] Store migration from 1.0 to 2.0



blueworld
Oct 09, 2012, 8:45 AM
Hello,

I have tried to migrate a store from 1.0 to 2.0. I am not sure about the Parameters, there is no more <BaseParams> in 2.0. I have tried a few things but the parameters wont be passed, only params that are passed are the paging params.

This is my old 1.0 code:



<ext:Store ID="ResultsStore" runat="server" AutoLoad="false">
<Proxy>
<ext:PageProxy />
</Proxy>
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="Id" Type="Int" />
<ext:RecordField Name="SortDate" Type="Date" />
<ext:RecordField Name="CustomerTourNumber" Type="String" />
<ext:RecordField Name="VehicleName" Type="String" />
<ext:RecordField Name="Tourtype" Type="String" />
<ext:RecordField Name="Extension" Type="String" />
<ext:RecordField Name="ReportName" Type="String" />
</Fields>
</ext:JsonReader>
</Reader>
<BaseParams>
<ext:Parameter Name="ReportName" Value="#{ReportName}.getValue()" Mode="Raw" />
<ext:Parameter Name="ReportExtension" Value="#{ReportExtensions}.getValue()" Mode="Raw" />
<ext:Parameter Name="FromDate" Value="#{DateFieldFrom}.getValue()" Mode="Raw" />
<ext:Parameter Name="ToDate" Value="#{DateFieldTo}.getValue()" Mode="Raw" />
</BaseParams>
<DirectEventConfig IsUpload="true" />
</ext:Store>


The search:



<ext:Button ID="ButtonSearch" runat="server" Icon="Magnifier" Text="Search">
<Listeners>
<Click Handler="#{ResultsStore}.load();" />
</Listeners>
</ext:Button>

Daniil
Oct 09, 2012, 11:17 AM
Hi @blueworld,

Please use the Parameters collection instead of BaseParams, and use StoreParameter instead of Parameter.

blueworld
Oct 09, 2012, 11:26 AM
Hi Daniil,

thank you. Now I have found it in the docs as well, I did not find it before because there is a typo:



31. Store .BasePrams has been renamed to .Parameters
Parameter has been renamed to StoreParameter


Its BasePrams instead of BaseParams.

Nevertheless, I am still struggling with another 1.0 store implementation, its a combox:

store:


<ext:Store ID="ReportNameStore" runat="server" AutoLoad="true">
<Proxy>
<ext:PageProxy />
</Proxy>
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="Name" />
</Fields>
</ext:Model>
</Model>
</ext:Store>


Combobox:



<ext:ComboBox ID="ReportName" runat="server" Editable="true" TypeAhead="true" QueryMode="Local"
StoreID="ReportNameStore" TriggerAction="All" SelectOnFocus="true" DisplayField="Name"
AllowBlank="true" ValueField="Name" EmptyText="Bericht" AnchorHorizontal="100%"
FieldLabel="Bericht">
<Triggers>
<ext:FieldTrigger Icon="Clear" HideTrigger="true" />
</Triggers>
<Listeners>
<Select Handler="this.getTrigger[0].show();" />
<BeforeQuery Handler="this.getTrigger[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
<TriggerClick Handler="if (index == 0) { this.clearValue(); this.getTrigger[0].hide(); }" />
</Listeners>


Serverside signature:




Protected Sub ReportNameStore_RefreshData(ByVal sender As Object, ByVal e As Ext.Net.StoreReadDataEventArgs) Handles ReportNameStore.ReadData

* Query * ....
Dim store As Store = sender
store.DataSource = queryResult
store.DataBind()
End Sub




Well, this combobox does not get filled, and if I try to open the combobox the browser debugger tells me
Uncaught TypeError: Cannot call method 'hide' of undefined

Daniil
Oct 09, 2012, 11:32 AM
thank you. Now I have found it in the docs as well, I did not find it before because there is a typo:

Its BasePrams instead of BaseParams.


Oh, I was unable to find because of this reason as well:) But I believed it should be there. Thank you for pointing it out!

Please start a new forum thread for another issue.

blueworld
Oct 09, 2012, 11:34 AM
Ok thank you, then close this thread please.