These links may interest you http://web2py.com/books/default/chapter/29/12#Plugins http://web2py.com/books/default/chapter/29/03#Adding-grids
On Wednesday, 24 April 2013 08:01:24 UTC-5, Domagoj Kovač wrote: > > Hi guys. > > I have this code in my view: > > {{if rows:}} > <div class="pager"> > {{number_of_pages = int(math.floor(number_of_records/ > settings["items_per_page"]))}} > {{if request.args:}} > {{current_page = int(request.args[0])}} > {{else:}} > {{current_page = 0}} > {{pass}} > > <div class="pager-info">Prikazujem: {{=settings[ > "items_per_page"]*current_page}} - > {{=settings["items_per_page"]*(current_page > + 1)}} od {{=number_of_records}}</div> > <div class="pages"> > {{for x in range(0, number_of_pages):}} > {{if current_page is x:}} > {{=A(x+1, _href=URL(request.controller,request > .function, args=[x]), _class="current")}} > {{else:}} > {{=A(x+1, _href=URL(request.controller,request > .function, args=[x]))}} > {{pass}} > {{pass}} > </div> > <div class="clear"></div> > </div> > {{pass}} > > This code is basically universal. If i want to make some kind of paging > plug in, what would be the best approach? Easiest thing at the moment would > be make just a view and move this code there and then include this view in > every grid page. > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.