cocoa.zhao Posted May 21, 2015 Posted May 21, 2015 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! Quote
tappatappa Posted May 21, 2015 Posted May 21, 2015 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. Quote
tappatappa Posted May 21, 2015 Posted May 21, 2015 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.... Quote
cocoa.zhao Posted May 22, 2015 Author Posted May 22, 2015 Hi, Thanks for your reply! I will try to clear all the listeners in pagingBar components, and handle these actions with my own clientside script. Quote
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.