[CLOSED] [1.0] GridPanel's reconfigure reset columns' filter property

  1. #1

    [CLOSED] [1.0] GridPanel's reconfigure reset columns' filter property

    Hi,
    I create runtime with web-service a gridpanel and its store; after I want to reload store and to do this I use:
    Grid.reconfigure(storeID,Grid.colModel);
    It works but this command clears columns' filter property; Any suggestions ???
    Many thanks.
    Last edited by Daniil; Sep 21, 2011 at 10:40 AM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Hi,

    Not sure why you call .reconfigure() to reload. Please clarify.
  3. #3
    hi,
    i have to call .reconfigure(...) because i called a webservice used to refresh a store

    <WebMethod(True)> _
        Public Function aaaaaaaaaaaaaaaaaaaaaaaaa(ByVal elemento As ObjElementoPannello, ByVal PaginaCorrente As Integer, ByVal field_Order As String, ByVal field_Direction As String, ByVal Ricaricamento As Boolean) As String
            Dim Pannello As New Ext.Net.Panel
            Pannello.ID = "pnlStore_xyz"
            Pannello.IDMode = IDMode.Static
            Pannello.Border = False
            Pannello.AutoScroll = False
            Pannello.AutoHeight = True
            Pannello.Height = 120
            Dim DTtest As New DataTable
            Dim St As New Ext.Net.Store
            St.ID = "str_xyz"
            St.IDMode = IDMode.Static
            St.RemoteSort = True
            St.SortInfo.Field = field_Order
            If field_Direction = "DESC" Then
                St.SortInfo.Direction = SortDirection.DESC
            Else
                If field_Direction = "ASC" Then
                    St.SortInfo.Direction = SortDirection.ASC
                Else
                    St.SortInfo.Direction = SortDirection.Default
                End If
            End If
            St.Reader.Add(CreateStoreColumns(DTtest))
            St.DataSource = DTtest
            St.DataBind()
            Pannello.ContentControls.Add(St)
            Dim result As String = ""
            Dim Resoutput As New DirectResponse(Pannello.ToScript(RenderMode.AddTo, "pnl_xyz"))
            result = Resoutput.Script
           
            Return result
        End Function
    after the eval(script string returned by the webservice),
    i call:
    grid.reconfigure(str_xyz, grid.colModel);
    is it more easy for you to understand what I would like to do?

    thanks
  4. #4
    What a sense to create new store? The store has new fields set? If fields the same but data different only then new store is not required. Why do you wrap the store by a panel?
  5. #5
    the store has a new fieldset and data is different (the columns are the same)

    I needed to put the store in panel because when I tried to do this there was an error:
    
    Dim St As New Ext.Net.Store
                St.ID = "str_" & IdBase
                St.IDMode = IDMode.Static
                St.RemoteSort = True
                St.SortInfo.Field = Ordinamento_Campo
                If Ordinamento_Direzione = "DESC" Then
                    St.SortInfo.Direction = SortDirection.DESC
                Else
                    If Ordinamento_Direzione = "ASC" Then
                        St.SortInfo.Direction = SortDirection.ASC
                    Else
                        St.SortInfo.Direction = SortDirection.Default
                    End If
                End If
                St.Reader.Add(CreateStoreColumns(DTtest))
                St.DataSource = DT
                St.DataBind()
    dim res as string = ""
    Dim Resoutput As New DirectResponse(st.ToScript(RenderMode.AddTo, "st_xyz"))
    res = Resoutput.Script
    I received the error
    "...only controls are allowed...."
  6. #6
    I see, you bind new store therefore filtering will be resetted (new store doesn't know about old store with filters)
    You have to reapply required filter manually
  7. #7
    hi,
    this is what I did to create the gridpanel:

    
     Dim Grid As New Ext.Net.GridPanel
            Grid.ID = "grd_" & IdBase
            Grid.StoreID = "str_" & IdBase
            Grid.Border = False
            Grid.Height = 90
            Grid.StripeRows = True
            Grid.Listeners.SortChange.Fn = "FF3DPannello_Azioni"
           
            Dim GF As New Ext.Net.GridFilters
            GF.ID = "gridfilter_" & IdBase
            GF.IDMode = Ext.Net.IDMode.Static
            GF.Local = False
            GF.FiltersText = "Filtro"
    
    Dim DT As New DataTable = test
            For Each col As Column In DT.Columns
                Dim colonna As Object
                Dim ColonnaGrid As New Ext.Net.Column.Config
                Dim filter As New Ext.Net.NumericFilter
                filter.DataIndex = col.ColumnID
                GF.Filters.Add(filter)
                colonna = New Ext.Net.Column(ColonnaGrid)
         Grid.ColumnModel.Columns.Add(colonna)
    
            Next
      Grid.Plugins.Add(GF)
    I don't have filters applied to store, but just applied to gridpanel.
    About this situation, is it better to filter the store instead of to filter the gridpanel?
    how could I do that?

    thank you very much
  8. #8
    There is no GridPanel filtering. GridFilters filters a grid's store.

    Well, you can try to save filters before WebService call and apply after.
    grid.lastFilters = grid.filters.getRecordFilter();
    and
    grid.store.filterBy(grid.lastFilters);
  9. #9
    hello,
    as you suggested in this post
    http://forums.ext.net/showthread.php...configure-Grid

    i created the whole grid with an attached store dinamically

    thank you very much

    I solved my problem
  10. #10
    Ok, thanks for the update.

Similar Threads

  1. [CLOSED] GridPanel startsWith Filter for all columns
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 20, 2012, 12:19 PM
  2. [CLOSED] Reset GridPanel columns to initial state
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Jul 18, 2011, 5:21 PM
  3. reset gridpanel pageindex to 0 after new filter
    By javadzarrin in forum 1.x Help
    Replies: 1
    Last Post: Aug 22, 2010, 8:29 AM
  4. Replies: 0
    Last Post: Aug 17, 2010, 5:20 PM
  5. [CLOSED] Reset store's sort info on grid reload/reconfigure
    By jchau in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Aug 10, 2010, 4:06 PM

Posting Permissions