picyka Posted January 11, 2022 Share Posted January 11, 2022 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 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 11, 2022 Share Posted January 11, 2022 3 minutes ago, picyka said: I have a situation here, that I need to do manual pagination Hello, Please explain in more details. Quote Link to comment Share on other sites More sharing options...
picyka Posted January 11, 2022 Author Share Posted January 11, 2022 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 Quote Link to comment Share on other sites More sharing options...
picyka Posted January 11, 2022 Author Share Posted January 11, 2022 I managed, using my own buttons, and ended up disabling the grid pagination buttons. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 11, 2022 Share Posted January 11, 2022 58 minutes ago, picyka said: I managed, using my own buttons, and ended up disabling the grid pagination buttons. Okay. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.