[web2py] Required field label

2018-06-19 Thread Tu Duong
Hi, what is the best way to add red * (or any indication that the field is required for user) in the label of the required field? Thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/i

[web2py] Allow to add new record from formdropdown list

2018-03-22 Thread Tu Duong
Hi, My database looks like this db.define_table('Device', Field('Name'), format='%(Name)s') db.define_table('Firmware', Field(DeviceID, 'reference Device', requires=IS_IN_DB(db, 'Device.id'), Field('Name')) I want to create a form that combine th

[web2py] Change style of the view sqlform.grid

2018-02-01 Thread Tu Duong
How to change the style for the "view details" page of sqlform.grid. For now, it's very "blank" Id 1 First Name Tony Age 23 I want at least the title is in bold, and both value and title in the same row. Thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - htt

[web2py] Re: How to dynamicly add SQLFORM.grid using JQuery

2018-01-16 Thread Tu Duong
) to retrieve a given grid as a web2py Ajax component."* I don't know Ajax, could you please give me an example based on my code? Thanks On Tuesday, January 16, 2018 at 7:35:52 AM UTC-8, Anthony wrote: > > On Tuesday, January 16, 2018 at 1:01:54 AM UTC-5, Tu Duong wrote: >&

[web2py] Re: How to dynamicly add SQLFORM.grid using JQuery

2018-01-15 Thread Tu Duong
I have more than 1 grid on the same page (about 10). I could do it, but it is not a best solution because I need to keep track of which gird is visible, hide that grid, and show the new selected one. I hope there is a better way to solve this... wondering why it does not work. It works beautiful

[web2py] Re: How to dynamicly add SQLFORM.grid using JQuery

2018-01-15 Thread Tu Duong
I have more than 1 grid on the same page (about 10). I could do it, but it is not a best solution. I hope there is a way to solve this... wondering why it does not work. It works beautiful with form -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/w

[web2py] Re: How to dynamicly add SQLFORM.grid using JQuery

2018-01-15 Thread Tu Duong
It shows part of the HTML code on the browser. Seems like the code for the grid is different -- 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

[web2py] Can't use JQuery to dynamically display my form.grid()

2018-01-15 Thread Tu Duong
Hi, I want to load a table's data when the Show Program button is pressed. This is what I do and does not work. -- default.py def index(): return dict( list_program = SQLFORM.grid(db.Program) ) # Program is a SQL table in my database -- index.html jQuery(document).ready(function(){ j

[web2py] How to dynamicly add SQLFORM.grid using JQuery

2018-01-15 Thread Tu Duong
Hi, I want to display the table's content when user clicks the button, here is my code and it does not work. I can display the SQLFORM, but for some reason, it does not work with SQLFORM.grid --*default.py* def index(): return dict( list_program = SQLFORM.grid(db.Program) ) --*ind