View Full Version : GridPanel, Store and switching datasources

Jun 04, 2012, 5:25 PM

Ik have an ext:GridPanel with an ext:Store.
The store is linked to a sqldatasource through the DataSourceID="SqlDataSourceTest1".
I want the store to switch between two datasources that have the same structure (different select, update en insert queries).
Switching between the datasources goes through two buttons. (changing the datasourceid of the store).
With selecting the data this works perfect. Data in the gridpanel is changing after clicking one of the buttons. But the updating does not work. I use a Lsitener with a click handler <Click Handler="#{TestGrid}.save();" />.
When checking what is happening by using the BeforeStoreChangedEvent I found out that the datasourceid is reset to the first selected datasourceid.

Very strange, because for selecting the data has used the new datasourceid.
Am i missing some kind of settings?

Hans Wapenaar

Sub clickStage(ByVal Sender As Object, ByVal e As DirectEventArgs)

Dim btnStage As Ext.Net.Button = CType(Sender, Ext.Net.Button)
If (btnStage.ID="btn1") Then
TestGrid.GetStore.DataSourceID = "SqlDataSourceTest1"
TestGrid.GetStore.DataSourceID = "SqlDataSourceTest2"
End If
End Sub

Jun 04, 2012, 9:48 PM
Follow up:

As a workaround:
I sticked to one DataSource and changed the select, update and insert commands (queries).
That's what I got working now: the commands are adjusted.

Hans Wapenaar