@Thai, you can implement your own GridSource for better performance. Check this thread<http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/5-3-6-GridDataSource-provided-row-index-to-getRowValue-int-td5718694.html>for help.
*---------------------* *Muhammad Gelbana* http://www.linkedin.com/in/mgelbana On Wed, Nov 13, 2013 at 10:17 AM, Antal van Kalleveen < an...@vankalleveen.net> wrote: > Hi, > > You are correct that the current provided implementations of the > GridDataSource (HibernateGridDataSource and JpaGridDataSource) will query > for the total number of rows in the database and therefor can kill > performance on the client side as well as on the DB side. Particulary if > sorting and filtering is applied. > > The GridDataSource is only an interface so its up to you on how you decide > to implement the getAvailableRows function. > > I may have another solution, I've written a small component library for > Tapestry with a 'PagedGrid' in it. This is an extension of the supplied > Grid component with a custom pager and a custom DataSource implementation > which does not query for the total number of rows and will perform much > faster with large datasets. > > The code can be found here: https://github.com/intercommit/Weaves > > And a demo is running here: > http://intercommitweavesdemo.intercommit.cloudbees.net/grid/pagedgriddemo > > Good luck, > Antal > > ---- OriginalMessage ---- > >From: "Thai Tran" <bubu...@gmail.com> > >To: "Tapestry users" <users@tapestry.apache.org> > >Sent: Wed, Nov 13, 2013, 03:54 > >Subject: [SPAM] Grid Pagination and Performance > > > >Good morning everyone (it is morning here :D) > > > >According to official documentation > >( > http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Grid.html > ), > >we only need to set the rowsPerPage to turn the pagination on without > >caring about the actual returned list 's size. Having said that, if the > >returned result contains millions of records, it will kill the server > >memory, IMO > > > >According to the none-official document > >( > http://jumpstart.doublenegative.com.au/jumpstart/examples/tables/griddatasources > ), > >we need to extends the GridDataSource in order to return the correct > >number of records from database to server > > > >I am just wondering, why does the misleading first way appear in the > >official document ? Or I am missing sth? > > > >Thai Tran > > > > > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > >For additional commands, e-mail: users-h...@tapestry.apache.org > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >