likemike Posted August 12, 2022 Share Posted August 12, 2022 Hello! I've got an TUnimDGBrid which is paged. If I scroll to the last row of the first page and I go to the next page (using the pageslider) the position of the grid is on the last row on the 2nd page. But I need the position of the grid at the beginning (top) of the 2nd page. I've tried something like that in : UnimDBGrid ->ExtEvents-> pageSlider.change function pageSlider.change(me, newValue, oldValue, eOpts) { pageData.toRecord = 1 } but that doesn't work. Any help will be appreciated Mike Link to comment Share on other sites More sharing options...
Sherzod Posted August 12, 2022 Share Posted August 12, 2022 Hello, How can we reproduce your case? Link to comment Share on other sites More sharing options...
likemike Posted August 13, 2022 Author Share Posted August 13, 2022 Hello! You will need a UnimDBGrid connected to a table of a database and set "paged" to true and "pagesize" for ex. to 20. But maybe it's not necessary to reproduce it. Is there a possibility to force UniGui to go to the top of a page after the user changes the page (with the pageslider at the bottom,) of a paged grid? Link to comment Share on other sites More sharing options...
Sherzod Posted August 13, 2022 Share Posted August 13, 2022 Hello, 1 hour ago, likemike said: You will need a UnimDBGrid connected to a table of a database and set "paged" to true and "pagesize" for ex. to 20. Okay. We have a demo: \FMSoft\Framework\uniGUI\Demos\Touch\DBGrid Editors 1 hour ago, likemike said: Is there a possibility to force UniGui to go to the top of a page after the user changes the page (with the pageslider at the bottom,) of a paged grid? 18 hours ago, likemike said: If I scroll to the last row of the first page and I go to the next page (using the pageslider) the position of the grid is on the last row on the 2nd page. The slider doesn't have a button like NextPage, does it? Link to comment Share on other sites More sharing options...
likemike Posted August 13, 2022 Author Share Posted August 13, 2022 No! It's like that: To show you, what I mean. I scroll down in the grid (page = 1 - vertical scrollbar is at the bottom): I click on the pageslider (page = 3 - vertical scrollbar stays at the bottom). But I need it to be at the top: . Link to comment Share on other sites More sharing options...
Sherzod Posted August 13, 2022 Share Posted August 13, 2022 Are you checking in desktop mode? Link to comment Share on other sites More sharing options...
Sherzod Posted August 13, 2022 Share Posted August 13, 2022 Okay, I understood. I will check. Link to comment Share on other sites More sharing options...
Sherzod Posted August 13, 2022 Share Posted August 13, 2022 You mean the scroll position. Link to comment Share on other sites More sharing options...
Sherzod Posted August 13, 2022 Share Posted August 13, 2022 26 minutes ago, likemike said: I scroll down in the grid (page = 1 - vertical scrollbar is at the bottom): 17 minutes ago, Sherzod said: You mean the scroll position. Try this approach: procedure TMainmForm.UnimDBGrid1AfterLoad(Sender: TUniCustomDBGrid); begin JSInterface.JSCode(#1'.getScrollable().scrollTo(0,0);', (Sender as TUnimDBGrid).JSControl); end; Link to comment Share on other sites More sharing options...
likemike Posted August 13, 2022 Author Share Posted August 13, 2022 Works perfect! Muchas gracias! Link to comment Share on other sites More sharing options...
Recommended Posts