[CLOSED] Refresh store after AfterRecordUpdated event

  1. #1

    [CLOSED] Refresh store after AfterRecordUpdated event

    Hi Geoff,

    I setted a Store with RefreshAfterSaving = always, OnAfterRecordUpdated, OnAfterRecordInserted, and OnRefreshData.

    While I correctly use refresh data after I inserted a record in my Grid, RefreshData evet fires, after I updated a record,
    click save, OnAfterRecordUpdated fires, I implemented my logic to update the business object
    but OnRefreshData event DOES NOT fire! So that I can't see changes (updates) I made in the Grid.
    I need to click refresh button to see made changes.

    Is this normal, or am I doing something wrong?

    Thank you

    Matteo


  2. #2

    RE: [CLOSED] Refresh store after AfterRecordUpdated event

    Hi,

    The OnRefreshData fires only if on the client side was called load/reload methods of store/grid
    During AjaxEvent you can call DataBind of Store for update data on client.

    If it is not helps you then please post simple example which demonstrating the problem and i'll try to help you

  3. #3

    RE: [CLOSED] Refresh store after AfterRecordUpdated event

    Hi Vlad,

    thanx for quick response, I have this code in the Grid:

    
    <ext:Button runat="server" ID="BT_SalvaQuest" Text="Salva" Icon="Disk">
      <Listeners>
        <Click Handler="#{MyGridPanel}.save();" />
      </Listeners>
    </ext:Button>
    and this codebehind:

    
    // this works fine, after this, code passes to Refresh event
    protected void MyStore_AfterRecordInserted(object sender, AfterRecordInsertedEventArgs e)
            {
                this.SaveObject(e);
            }
    
    // after this call, code does not pass to Refresh evet
    protected void MyStore_AfterRecordUpdated(object sender, AfterRecordUpdatedEventArgs e)
            {
                this.SaveObject(e);
                 this.MyStore.DataBind(); // I tried this without success
            }
    
    protected void MyStore_Refresh(object sender, StoreRefreshDataEventArgs e) 
            {
                this.MyStore.DataBind();
            }
    Thank you

    Matteo
  4. #4

    RE: [CLOSED] Refresh store after AfterRecordUpdated event

    Hi,

    During saving process the DataBinding doesn't allowed because it can breaks saving logic. I reproduced bug in RefreshAfterSaving property. I can suggest a few solutions while i fixing bug

    1. Set RefreshAfterSaving=Always and to add DataSourceProxy to your Store
                <Proxy>
                    <ext:DataSourceProxy/>
                </Proxy>
    2.Another solution: Set RefreshAfterSaving=None and to add listener for Store
          <CommitDone Handler="#{Store1}.reload();" />
  5. #5

    RE: [CLOSED] Refresh store after AfterRecordUpdated event

    Thank you Vlad,

    ok! I tried both solutions, they work fine.
    I adopted the first one and had the result I expected.

    Matteo
  6. #6

    Grid panel Validation

    Hi,

    I have added column model in grid panel from code behind.

    
    
      foreach (DataColumn dc in dtData.Columns)
                {
                    if (count > 3)
                    {
                        Column co = new Column();                 
                        co.Width = Unit.Pixel(75);
                        co.DataIndex = dc.ColumnName;
                        co.Header = dc.ColumnName;
                        TextField c = new TextField();                   
                        c.ID = count.ToString();
                        co.Editor.Add(c);
                        this.GridPanel1.ColumnModel.Columns.Add(co);
                    }
                    count++;
                }
    I am adding Textfield as above.

    Now I want to validate each textField as decimal or int.

    Also total row should not be editable and color of that row should be different.

    Please refer the attachement.
    Attached Thumbnails Click image for larger version. 

Name:	test.JPG 
Views:	252 
Size:	51.4 KB 
ID:	1927  
  7. #7
    Hi,

    Please create a new thread because your question is not rather related to this thread.

Similar Threads

  1. [CLOSED] Refresh Event in Paging Toolbar
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Aug 06, 2011, 2:46 PM
  2. Replies: 20
    Last Post: Nov 24, 2010, 12:39 PM
  3. [CLOSED] Exporting Data using Refresh event
    By ecerrillos in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 22, 2010, 3:32 PM
  4. Trigger store refresh event
    By dan182 in forum 1.x Help
    Replies: 4
    Last Post: Jun 23, 2010, 2:09 PM
  5. [CLOSED] [1.0] Grid Store Refresh Event behavior overriding
    By webclouder in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 25, 2010, 9:40 AM

Posting Permissions