Jump to content

Row position in an paged UnimDBGrid when changing the page!


likemike

Recommended Posts

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

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

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

No! 

It's like that:

snap.thumb.jpg.a9ff4c2b7ab673b506bf440ef4d0a33b.jpg

To show you, what I mean. 

I scroll down in the grid (page = 1 - vertical scrollbar is at the bottom):

Snap_001.jpg.aebaf3c2923aa07661ee368aa98a2a9a.jpg

I click on the pageslider (page = 3 - vertical scrollbar stays at the bottom). But I need it to be at the top:

Snap_002.jpg.603fd0a16fe1afca1c05fd30173dec30.jpg.

Link to comment
Share on other sites

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

×
×
  • Create New...