GridPanel, Store and switching datasources

  1. #1

    GridPanel, Store and switching datasources

    Hi,

    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?


    Thanks,
    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.DataBind()
    Else
    TestGrid.GetStore.DataSourceID = "SqlDataSourceTest2"
    TestGrid.GetStore.DataBind()
    End If
    End Sub
  2. #2
    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

Similar Threads

  1. Replies: 0
    Last Post: May 30, 2012, 8:44 PM
  2. Replies: 1
    Last Post: Jul 23, 2010, 10:02 PM
  3. Replies: 4
    Last Post: Apr 09, 2010, 1:07 PM
  4. [CLOSED] switching themes on controls
    By LeeTheGreek in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 17, 2009, 5:12 AM
  5. Linked Combo Boxes using DataSources
    By rthiney in forum 1.x Help
    Replies: 3
    Last Post: Aug 06, 2009, 12:36 PM

Tags for this Thread

Posting Permissions