JqGrid module

103 views
Skip to first unread message

Jim Karsten

unread,
Jul 30, 2011, 2:34:02 PM7/30/11
to web...@googlegroups.com
Ray Luo and I are developing a web2py jqgrid module that allows you to insert a jqgrid into a page with only a few lines of code.

# 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 JqGrid(globals(), db.things)()                                      

See http://www.web2pyslices.com/slices/take_slice/140

Johann Spies

unread,
Aug 4, 2011, 8:53:04 AM8/4/11
to web...@googlegroups.com
On 30 July 2011 20:34, Jim Karsten <iiij...@gmail.com> wrote:
Ray Luo and I are developing a web2py jqgrid module that allows you to insert a jqgrid into a page with only a few lines of code.
...
                                                                               
# In controller                                                                
                                                                               
JqGrid = local_import('jqgrid', app='jqgrid', reload=True).JqGrid              
JqGrid.initialize_response_files(globals(), theme='ui-lightness', lang='en')   
                                                                               
def things():                                                                  
    return JqGrid(globals(), db.things)()                                      


Thanks for your work.  It seems useful. Just a question about way to specify a datasource.  How would you handle a complex query involving several tables?

Regards
Johann
--
 May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord!  His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and excellence.
                                                    2 Pet. 1:2b,3a

Jim Karsten

unread,
Aug 5, 2011, 12:24:14 PM8/5/11
to web...@googlegroups.com
Johann, I updated the jqgrid application to include demos for using complex queries and accessing data from a webservice. Demos are found in the default.py controller. If you cloned the git repo, just run 'git pull' in the repo directory and you should get the latest.

Cheers,
Jim
Reply all
Reply to author
Forward
0 new messages