Jump to content
uniGUI Discussion Forums
Janex

Grid refresh button

Recommended Posts

Hi.

How can I catch grid refresh button push ?

I need dataset full refresh when I push refresh button ....

 

WBR

Janex

 

Share this post


Link to post
Share on other sites

Refresh the query behind the dbgrid !

No, this is not good way for me, because then I must add new button for refresh, but integrated in grid refresh button I cannot remove :(

I cannot say to users :"Push this button, newer push button in grid" .

I found ext event function store.refresh(sender, eOpts), but this event fire every time when data is loading, not only when refresh

button is pressed :(

Share this post


Link to post
Share on other sites

I assume you're using a UDBGrid?

If that's the case, you can:

 

UDBGrid.Refresh;

Share this post


Link to post
Share on other sites

I assume you're using a UDBGrid?

If that's the case, you can:

 

UDBGrid.Refresh;

Yes, UDBGrid, but I need to refresh dataset and reload data into grid exactly via push refresh button on grid, but when I press

refresh button on grid, grid reload data from dataset without dataset data refreshing ... there is the problem.

Share this post


Link to post
Share on other sites

Do you have a UDBNavigator? Only UDBGrid paged and refresh button?

If you have UDBNavigator, user refresh Dataset from there, then in dataset event AfterRefresh you call UDBGrid.Refresh;

That refresh button in UDBGrid, IMHO, was not designed for refresh the datasource.

Farshad can correct me with this.

Regards.

Share this post


Link to post
Share on other sites

I have only UDBGrid paged with refresh button.

I will when push refresh button, not only old data ir refetched from dataset, but

refetched fresh data (with dataset refreshing)...

Without UDBNavigator.

Without any other additional button.

Exactly via UDBGrid refresh button.

Share this post


Link to post
Share on other sites

Hi.

How can I catch grid refresh button push ?

I need dataset full refresh when I push refresh button ....

 

WBR

Janex

 

Hi Janex.

 

I think you can override the "refresh":

 

UniDBGrid1 -> ....

function afterrender(sender, eOpts)
{  
  sender.pagingBar.getComponent("refresh").handler = function () {
    //your custom logic...
    alert("test");
  }   
}

Best regards.

Share this post


Link to post
Share on other sites

*Bump*

 

I too want a way of calling a total refresh when the DBGrid "refresh" button is clicked.

 

How would you call a dataset close and dataset open within the block below.

I have it working so it shows "test", but how to access the datasets on the form and call the required methods. Is this even possible?

function afterrender(sender, eOpts)
{  
  sender.pagingBar.getComponent("refresh").handler = function () {
    //your custom logic...
    alert("test");
  }   
}

Also can someone explain what this button on the grid does? It obviously doesn't refresh the underlying dataset, I am correct in saying it just refreshes the grid?

 

Thanks,

 

Dan.

Share this post


Link to post
Share on other sites

Hi,

 

Try this:

 

1. UniDBGrid1 -> ClientEvents -> ExtEvents -> function afterrender:

function afterrender(sender, eOpts) 
{
    var me = sender;
    if (me.pagingBar) {
        me.pagingBar.getComponent("refresh").handler = function() {
            ajaxRequest(me, '_refresh', [])
        }
    }
}

2. UniDBGrid1 -> OnAjaxEvent:

procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName = '_refresh' then
  begin
    // your custom logic
    ShowMessage('refresh');
  end;
end;

Best regards,

Share this post


Link to post
Share on other sites

Wow that was quick -  thanks.

 

PS - Is their any more documentation on this sort of thing, or is it just a case of becoming more familiar with ExtJS?

Share this post


Link to post
Share on other sites

×