In model
db.define_table('category',
Field('name', label='Name of Category'), format='%(name)s')
db.define_table('things',
Field('name'),
Field('quantity', 'integer'),
Field('owner'),
Field('price','double'),
Field('category', db.category))
In controller
JqGrid = local_import('jqgrid', app='jqgrid', reload=True).JqGrid
JqGrid.initialize_response_files(globals(), theme='ui-lightness', lang='en')
def things():
return dict(jqgrid=JqGrid(globals(), db.things)())
A view is not necessary, but can be used to customize the look. For example:
{{extend 'layout.html'}}
<h1>Things</h1>
{{=jqgrid}}
Comments (13)
0
sif-baksh-10957 9 years ago
Do you have an example how to use it with out a DB?
New to web2py
I'm making a restful API call that returns a JSON output
I would love to use this method.
Thanks in advance
replies (1)
0
luciusagarthy 10 years ago
Hey,
to my previous question: I found it out, it was enough to call:
before calling return dict()
0
luciusagarthy 10 years ago
Hallo,
nice job. I started with web2py week ago and want to implement jqgrid.
I am using my own db and cannot figure out, how to show column from foreignkey table, it is
showing just id column, but not name column (like db.thing with db.category.name in second column).
Another think: 'rownumbers': 'true' does not work properly, it adds column for rownumbers, but no rownumbers are shown,
just data are shift one column left :(, do not know if I have to manually add row numbers or jqgrid generates it.
Can you help. Sorry for my english, I am used just to read manuals :(.
0
joel-robinson-10375 12 years ago
I can't seem to figure out how to do and AND query. I tried somthing like this:
How can I combine queries?
Thanks for you help.
replies (1)
0
iiijjjiii 12 years ago
0
telloroberto 12 years ago
0
johannspies 13 years ago
0
johannspies 13 years ago
0
iiijjjiii 13 years ago
0
johannspies 13 years ago
0
iiijjjiii 13 years ago
0
johannspies 13 years ago
0
iiijjjiii 13 years ago