hi,
does anyone knows how to create spatial page load by ajax (like
facebook does in your home page)? i mean, i want to create my index
view is to load the table fields spatial not all, currently, i'm tryin
to modify the pagination and use it into ajax function.
e.g.
def __index(table):
if len(request.args):
page = int(request.args[0])
else:
page = 0
items_per_page = 20
limitby = (page * items_per_page, (page + 1) * items_per_page + 1)
rows = db().select(table.ALL, limitby = limitby, orderby =
~table.id)
return dict(rows = rows, page = page, items_per_page =
items_per_page)
<script>
jQuery(document).ready(function(){
jQuery('.view').click(function(){ajax('{{=request.controller}}',
[page + 1], 'comments')});
});
</script>
<div class = "comments">
{{for i, row in enumerate(rows):}}
{{if i == items_per_page: break}}
{{=row.title}}
{{=BR()}}
{{pass}}
</div>
{{if len(rows) > items_per_page:}}
{{=DIV(A(T('View'),
_href = '#'),
_class = 'view')}}
{{pass}}
no error occured but the ajax function is not running, i know there is
a mistook on my code, could anybody know how to fix it, please? or is
there any way to do spatial page load?
any help is greatly appreciate, thank you so much in advance