Hi All,
      Can anyone let me know how to use SQLForm.grid properly or tell
me what I am missing. I have not installed any jquery plugin for the
same (assuming that it is part of 1.99.2 by default). I cannot see the
complete grid, just some buttons and data as per my query below. Also
the links do not function when clicked. The table does not show any
backgroud color or anything. Simply it doesnt look like a jquery
grid.  My code is as below -

My machine - Windows7 , IE9 and Firefox 7.0, Chrome.
Web2py- Latest stable (1.99.1)

#---------Controller- (default.py)---
def index():
    """
    example action using the internationalization operator T and flash
    rendered by views/default/index.html or views/generic.html
    """
    #Posts grid - SQLForm.grid
    #grid = SQLFORM.grid(db.projects_posts)
    query = ((db.projects_posts.post_visibility=="Classified"))
    columns = ('projects_posts.title',
               'projects_posts.project_details',
               'projects_posts.estimated_worth'
              )
    headers ={'projects_posts.title': 'Title',
              'projects_posts.project_details': 'Details',
              'projects_posts.estimated_worth': 'Worth'}

    form = SQLFORM.grid( query=query, columns=columns,
headers=headers,
                         deletable=False, editable=False, csv=False,
maxtextlength=64 )


    return dict(form=form)

#--------- View ---  (index.html)
{{extend 'layout.html'}}
{{=form}}


Also, if possible please refer me to the proper documentation for
SQLForm.grid. Again, if I include the parameter  form =
SQLForm.grid(.....,  ui="jquery-ui") in above code, the buttons
disappear and it only shows me links for 'view' etc.

Q: What is the exact proper method to use SQLForm.grid -
Q: What all libraries do I need to include? where?
Q: How to make links work the way they should ?
Q: Can search be customized? How?
Q: Is this documented in online book?  - did not find much about it in
version 3.2 though.

Please advice or refer me to the proper thread(though I checked
several to find solutions).

Regards, Rahul

Reply via email to