Jump to content

UniDBGrid manual pagination


picyka

Recommended Posts

I have a situation here, that I need to do manual pagination I tried using the grid Ajax event

 

procedure TUniFrameCadFechamento.UniDBGridVeiculoAjaxEvent(Sender: TComponent;
  EventName: string; Params: TUniStrings);
begin
  if Self.ActionReg = TActionReg.acEdit then
  begin
    if SameText('data',EventName) then
    begin
      if Self.FCurrentPage = (Params['page'].AsInt64(0)-1) then
        Exit;

      Self.CurrentObject<TFechamento>.Veiculos := Service.xxxxxxxx(Self.CurrentObject<TFechamento>.Id, Params['limit'].AsInt64(0), (Params['page'].AsInt64(0)-1));
      Self.Dataset.ReloadList(Self.CurrentObject<TFechamento>.xxxxxxx);
      Self.FCurrentPage := (Params['page'].AsInt64(0)-1);
    end;
  end;
end;

it worked for a part, but I need to tell the grid which page it is, because it always stays on page 1

Link to comment
Share on other sites

7 minutes ago, Sherzod said:

Olá

Por favor, explique em mais detalhes.

 

9 minutes ago, Sherzod said:

Olá

Por favor, explique em mais detalhes.

I work with List of Objects, I'll have a method where I pass the page number and the number of records.

when I open the screen, system loads page 0 with 25 records.

When the user changes the page in the grid, I need to go to the bank and load 25 more records,

then go to the next page.

but the 1 page is lost.

how can i control the number of pages manually in dbgrid

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...