[web2py] Customize SQLFORM.grid view page and add custom Back button
I have a controller that creates a grid off of a table -- very basic grid. I test to see if the user is viewing an item in the grid (if request.args and request.args[0] == 'view') and if so, I customize the view to present the information in the grid in a different layout. Now, I'd like to add a back button similar to what you get on the standard view for a grid but without displaying the grid on the 'view' page. I know how to create the button in the view, but I'm not sure how to create the URL since it's using the signature in the link. {{=A(T('Back'), _href=URL(), _class='btn')}} -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Customize SQLFORM.grid
Hello, I would like to take advantage of SQLFORM.grid search, listing and pagination capabilities to generate a listing from a table, but I need to customize the resulting rows like this: https://lh3.googleusercontent.com/-TbnhU4p9EOw/VA_hxFcXi_I/BYI/Ti2JNW4AdAg/s1600/Screen%2BShot%2B2014-09-10%2Bat%2B02.23.35.png Until now I only have this: users = SQLFORM.grid(db.users,fields=[db.users.id, db.users.first_name, db.users.last_name], headers={'users.id':'id','users.first_name':'Nombre', 'users.last_name':'Apellido'}, sortable=False, deletable=False, editable=False, create=False, csv=False, formstyle=div) Which results into this: https://lh4.googleusercontent.com/-E7cySzUy2Bw/VA_iuQU_5CI/BYQ/n5mLgALWJcs/s1600/Screen%2BShot%2B2014-09-10%2Bat%2B02.33.16.png I'm using Bootstrap 3. Any help will be appreciated. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Customize SQLFORM.grid fields
Hello everyone. I'm new to web2py and I have a question about customizing fields in SQLform.grid. Probably the most frequently asked question for you :) Let me describe what I want to do: There is a table consisting of the following columns: id | min_time | max_time | execute_time | level_warn | lastdate These values ??- runtime SQL-script from database Firebird: min_time - the minimum execution time max_time - maximum execution time execute_time - the actual execution time If execute_time = min_time, then level_warn = 1 If execute_time min_time max_time, then level_warn = 2 If execute_time max_time, then level_warn = 3 Finally, a question: How to make depending on the value of level_warn, table cell that contains the value, color codes? For example, level_warn = 1, color - green. level_warn = 2, color - yellow. level_warn = 3, color - red. My controller is as follows: def temp (): response.view = 'temp.html' db.TEMPER_RC.id.readable = False sort_order = [db.TEMPER_RC.id] headers = {'TEMPER_RC.name': 'RC' 'TEMPER_RC.min_time': 'Min. time, min. ' 'TEMPER_RC.max_time': 'Max. time, min. ' 'TEMPER_RC.execute_time': 'Act. time, min. ' 'TEMPER_RC.level_warn': 'alarm level' 'TEMPER_RC.lastdate': 'Time Check'} grid = SQLFORM.grid (db.TEMPER_RC, user_signature = True, deletable = False, headers = headers, editable = False, create = False, paginate = 30, csv = False, maxtextlength = 31, orderby = sort_order, ui = 'web2py') return locals () -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Customize SQLFORM.grid
Hi, In the old framework I would just query the database and loop through the values manually creating the HTML table etc... Which allows me to do something like this: types = { 'bp': 'Product Bonus', 'sb': 'Sponsor Bonus', } table for row in rows: tr thType/th tdtypes[row.type]/td /tr /table Is there a way to use SQLFORM.grid and tell it to display a dictionary value based on the key stored in the database? -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com
[web2py] CUSTOMIZE SQLFORM.grid
I need not VIEW / EDIT / DELETE records in selected db table. I want user to be redirected to another page after clicking some link. But I have no ideas of how to customise grid. Is it possible to add some additional link to each record in SQLFORM.GRID?