how cool is that

44 views
Skip to first unread message

Niphlod

unread,
Sep 24, 2013, 6:06:25 PM9/24/13
to web2py-d...@googlegroups.com
What the new hookable events enabled ......

create a new app
1. fetch https://raw.github.com/HubSpot/pace/master/pace.js and put under static/js/pace.js
2. fetch https://raw.github.com/HubSpot/pace/master/themes/pace-theme-corner-indicator.css and put under static/css/pace.css
3. alter layout.html

.....
<script src="{{=URL('static','js/modernizr.custom.js')}}"></script>
<script src="{{=URL('static','js/pace.js')}}"></script>
<link href="{{=URL('static','css/pace.css')}}" rel="stylesheet" />
.....

4. put in controllers/default.py

def test():
    script
= """$(function() {
    $(document).on('ajax:beforeSend', function() {
        Pace.restart();
    })
    })"""

   
return dict(a=LOAD('default', 'thegrid.load', ajax=True), script=SCRIPT(script))

def thegrid():
   
import time
    time
.sleep(5)
    grid
= SQLFORM.grid(db.auth_user, user_signature=False)
   
return dict(grid=grid)

5. enjoy clicking around /appname/default/test .

6. (at least for me) Remember to close jaws.
Reply all
Reply to author
Forward
0 new messages