Jump to content


Photo

Grid refresh button


  • Please log in to reply
11 replies to this topic

#1 Janex

Janex

    Active Member

  • Members
  • PipPipPip
  • 63 posts

Posted 15 August 2014 - 07:19 AM

Hi.

How can I catch grid refresh button push ?

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

 

WBR

Janex

 


  • 0

#2 adragan

adragan

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 157 posts

Posted 15 August 2014 - 08:46 AM

Refresh the query behind the dbgrid !


  • 0

#3 Janex

Janex

    Active Member

  • Members
  • PipPipPip
  • 63 posts

Posted 15 August 2014 - 09:21 AM

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 :(


  • 0

#4 J. Oriol M.

J. Oriol M.

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 92 posts
  • LocationColombia

Posted 15 August 2014 - 04:22 PM

I assume you're using a UDBGrid?

If that's the case, you can:

 

UDBGrid.Refresh;


  • 0

#5 Janex

Janex

    Active Member

  • Members
  • PipPipPip
  • 63 posts

Posted 15 August 2014 - 04:39 PM

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.


  • 0

#6 J. Oriol M.

J. Oriol M.

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 92 posts
  • LocationColombia

Posted 15 August 2014 - 04:53 PM

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.


  • 0

#7 Janex

Janex

    Active Member

  • Members
  • PipPipPip
  • 63 posts

Posted 15 August 2014 - 08:08 PM

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.


  • 0

#8 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3475 posts

Posted 18 August 2014 - 05:20 AM

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.


  • 0

#9 Janex

Janex

    Active Member

  • Members
  • PipPipPip
  • 63 posts

Posted 18 August 2014 - 11:40 AM

Super!!! :-)
Thanks, good solution for me, it work, yeeeeeee :-)
  • 0

#10 dan602

dan602

    Member

  • uniGUI Subscriber
  • PipPip
  • 25 posts

Posted 03 November 2017 - 04:51 PM

*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.


  • 0

#11 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3475 posts

Posted 03 November 2017 - 05:07 PM

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,


  • 0

#12 dan602

dan602

    Member

  • uniGUI Subscriber
  • PipPip
  • 25 posts

Posted 03 November 2017 - 05:16 PM

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?


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users