55143681 Posted June 21, 2021 Share Posted June 21, 2021 My table maybe have 50000(which>65536) records, I want to show 50 records every page, So I set UniDBGrid's pagesize=50, and set my UniQuery's fetchRows=50, But ,I can see one page,no more pages. How to show every page with 50 records one page and use PagingBar to turn to every page ? Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted June 21, 2021 Share Posted June 21, 2021 2 hours ago, 55143681 said: My table maybe have 50000(which>65536) records, I want to show 50 records every page, So I set UniDBGrid's pagesize=50, and set my UniQuery's fetchRows=50, But ,I can see one page,no more pages. How to show every page with 50 records one page and use PagingBar to turn to every page ? As your query returns only 50 rows, unigui will show the total 50. You should use only paging from unigui side. Are there any problems about paging? Quote Link to comment Share on other sites More sharing options...
55143681 Posted June 22, 2021 Author Share Posted June 22, 2021 10 hours ago, Hayri ASLAN said: As your query returns only 50 rows, unigui will show the total 50. You should use only paging from unigui side. Are there any problems about paging? As you know :UniQuery's fetchRows max can be set to 65535, If my table have more than 65535 records, than,How can I turn pages to display the records behind 65535? Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted June 22, 2021 Share Posted June 22, 2021 Try UniQuery.SpecificOptions.Values['FetchAll'] := 'True'; Quote Link to comment Share on other sites More sharing options...
55143681 Posted June 29, 2021 Author Share Posted June 29, 2021 On 6/22/2021 at 4:55 PM, Oliver Morsch said: Try UniQuery.SpecificOptions.Values['FetchAll'] := 'True'; That means fetch all the records a time? can the system hold all the records? or All the records are paged,but only return one page records every time? Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted June 29, 2021 Share Posted June 29, 2021 It fetches / caches all the records on the server. If you use server cursor for db components the data is cached in db server, if you use client cursor the data is chached in UniGUI server. To the client (browser) is always sent one page. Quote Link to comment Share on other sites More sharing options...
x11 Posted July 1, 2021 Share Posted July 1, 2021 On 6/21/2021 at 2:11 PM, 55143681 said: I want to show 50 records every page, try this UniDBGrid1.WebOptions.PageSize := 50; TUniQuery(UniDBGrid1.DataSource.DataSet).FetchRows := 50; TUniQuery(grid.DataSource.DataSet).SpecificOptions.Values['FetchAll'] := 'False'; TUniQuery(grid.DataSource.DataSet).SmartFetch.LiveBlock := True; TUniQuery(grid.DataSource.DataSet).SmartFetch.Enabled := True; UniDBGrid1.Summary.Enabled := True; UniDBGrid1.WebOptions.Paged := True; UniDBGrid1.BufferedStore.Enabled := False; // bug http://forums.unigui.com/index.php?/topic/17115-%D0%BE%D1%88%D0%B8%D0%B1%D0%BA%D0%B0-uncaught-typeerror-i-is-undefined-%D0%BF%D0%BE%D0%B4%D0%B2%D0%B8%D1%81%D0%B0%D0%B5%D1%82-%D0%BF%D1%80%D0%B8%D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5/ grid.JSInterface.JSConfig('bufferedRenderer', [False]); Quote Link to comment Share on other sites More sharing options...
55143681 Posted July 7, 2021 Author Share Posted July 7, 2021 On 7/1/2021 at 3:07 PM, x11 said: try this UniDBGrid1.WebOptions.PageSize := 50; TUniQuery(UniDBGrid1.DataSource.DataSet).FetchRows := 50; TUniQuery(grid.DataSource.DataSet).SpecificOptions.Values['FetchAll'] := 'False'; TUniQuery(grid.DataSource.DataSet).SmartFetch.LiveBlock := True; TUniQuery(grid.DataSource.DataSet).SmartFetch.Enabled := True; UniDBGrid1.Summary.Enabled := True; UniDBGrid1.WebOptions.Paged := True; UniDBGrid1.BufferedStore.Enabled := False; // bug http://forums.unigui.com/index.php?/topic/17115-%D0%BE%D1%88%D0%B8%D0%B1%D0%BA%D0%B0-uncaught-typeerror-i-is-undefined-%D0%BF%D0%BE%D0%B4%D0%B2%D0%B8%D1%81%D0%B0%D0%B5%D1%82-%D0%BF%D1%80%D0%B8%D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5/ grid.JSInterface.JSConfig('bufferedRenderer', [False]); Thanks a lot,Only the follow will work . UniDBGrid自带自动分页功能,只需要对UniDBGrid和其关联的数据查询控件UniQuery做几个简单的属性设置即可,比如想让每页显示50条记录,设置如下: 1) UniDBGrid设置:WebOptions.Paged=True,WebOptions.PageSize=50 2) UniQuery设置:FetchRows=50,SmartFetch.Enabled=True Quote Link to comment Share on other sites More sharing options...
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.