Jump to content

Paging Stored Procedure with TUniDBGrid?


cocoa.zhao
 Share

Recommended Posts

TDataSet paging is implementation-specific.

 

For instance, if you are using ODAC TOraQuery (like I do) you set

TOraQuery::FetchAll = false

TOraQuery::FetchRows= <desired number or rows>

 

Still, the uniGUI paging does NOT work well with paged queries, because it "pages" only the rows actually fetched (otherwise how can it tell you the total number of pages in advance?), and for what I have seen, once you reach the end of the page it doesn't fetch the next page. So, I'd suggest you to implement your own implementation-specific PageBar Frame.

Link to comment
Share on other sites

Query and grid initialization

_query->FetchAll = false;
_query->FetchRows = _pagesize;
_grid->WebOptions->Paged = true;
_grid->WebOptions->PageSize = _pagesize;
_grid->WebOptions->FetchAll = false;

	// hide uniGUI pagebar
_grid->ClientEvents->ExtEvents->Values[L"afterrender"] = L" function(sender,eOpts)\
{\
	if (sender.dockedItems.items[1])\
		{sender.dockedItems.items[1].hide();}\
}";

After this, you need to manually implement all the buttons to go to next page, previous page, first page....

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.

 Share

×
×
  • Create New...