auto-paginator

26 views
Skip to first unread message

Janis Volbergs

unread,
Nov 14, 2012, 9:16:26 AM11/14/12
to agile-too...@googlegroups.com
Just out of curiosity, developed a simple auto-paginator which would work with any Grid (and also lister).

Code:

        $g=$this->add("Grid");
        
$g->setModel($m, array("id""name"));
        
$g->add("misc/Controller_AutoPaginator")
            ->
setLimit(10);


When you scroll page to bottom, it would reload the grid adding 10 more rows.

I must note that it's very trivial and is not adding actual 10 lines, but rather re-reloading the grid with increased limit. In future, when ui.grid is revamped, we will have room to make it more efficient.

Also, it was nice to find that 12 lines of code was enough to make this controller work :) Actually, could be even a few lines less.

This controller is part of misc add-on namespace and available in master branch.

Regards,
Janis

Gabriel Balint

unread,
Nov 14, 2012, 9:39:30 AM11/14/12
to agile-too...@googlegroups.com

Thanks, but can you provide a user/password, your example requires login.

 

Thank you,

  Gabriel

--
 
 

Janis Volbergs

unread,
Nov 14, 2012, 9:41:20 AM11/14/12
to agile-too...@googlegroups.com
Fixed

On Nov 14, 2012, at 4:39 PM, "Gabriel Balint" <gabriel...@gmail.com> wrote:

Thanks, but can you provide a user/password, your example requires login.
 
Thank you,
  Gabriel
 
From: agile-too...@googlegroups.com [mailto:agile-toolki...@googlegroups.com] On Behalf Of Janis Volbergs
Sent: Wednesday, November 14, 2012 9:16 AM
To: agile-too...@googlegroups.com
Subject: [atk4] auto-paginator
 
Just out of curiosity, developed a simple auto-paginator which would work with any Grid (and also lister).
 
Code:
 
        $g=$this->add("Grid");
        
$g->setModel($m, array("id""name"));
        
$g->add("misc/Controller_AutoPaginator")
            ->
setLimit(10);
 
 
When you scroll page to bottom, it would reload the grid adding 10 more rows.
 
I must note that it's very trivial and is not adding actual 10 lines, but rather re-reloading the grid with increased limit. In future, when ui.grid is revamped, we will have room to make it more efficient.
 
Also, it was nice to find that 12 lines of code was enough to make this controller work :) Actually, could be even a few lines less.
 
This controller is part of misc add-on namespace and available in master branch.
 
Regards,
Janis
-- 
 
 

--    

Bob Siefkes

unread,
Nov 14, 2012, 10:25:30 AM11/14/12
to agile-too...@googlegroups.com, j...@agiletech.ie
Impressive!... I was looking for the page next / previous navigation and suddenly it loads more items... nice!

Romans Malinovskis

unread,
Nov 14, 2012, 9:19:09 AM11/14/12
to agile-too...@googlegroups.com

Just out of curiosity, developed a simple auto-paginator which would work with any Grid (and also lister).

Code:

        $g=$this->add("Grid");
        
$g->setModel($m, array("id""name"));
        
$g->add("misc/Controller_AutoPaginator")
            ->
setLimit(10);


When you scroll page to bottom, it would reload the grid adding 10 more rows.

I must note that it's very trivial and is not adding actual 10 lines, but rather re-reloading the grid with increased limit. In future, when ui.grid is revamped, we will have room to make it more efficient.

Thanks for post, Janis, It’s really great.

The direction of Agile Toolkit is to provide a simple and flexible base components. That’s a great use of native features but the more efficient way of loading would imply a more specific requirements for the client-side HTML.

I also should note, that your paginator might also work with Listers.

Also, it was nice to find that 12 lines of code was enough to make this controller work :) Actually, could be even a few lines less.

This controller is part of misc add-on namespace and available in master branch.

Maybe you should move it into the ambient add-ons?



--
I am working with my team on a VERY URGENT project now. I apologize for the delay in answering your email(s).

Romans Malinovskis is the author of the revolutionary PHP Framework: the “Agile Toolkit” (www.agiletoolkit.org). Please show your support by raising awareness about Agile Toolkit.

Refer commercial web development projects towards our skilled developer team: http://www.agiletech.ie/company/

NEW: Our London team is hiring Lead Developer: http://bit.ly/TbqfyY

NEW: Learn Agile Toolkit with over 10 hours of practical screencast footage: htttp://agiletoolkit.org/tutorial 

Reply all
Reply to author
Forward
0 new messages