Jump to content

Recommended Posts

Posted

Hi Guys,

 

Is there a way to customize the paging operation?
I don't want to load all the records in a TDataSet.

What can I do to get the page I need only, and with the paging toolbar working still?

 

Thanks in advance!

Posted

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.

Posted

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....

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...