You cannot have two grids in the same page.

On Monday, 18 June 2012 06:09:24 UTC-5, rahulserver wrote:
>
> I tried to use two sqlform.grid in a web2py form. It does work as intended 
> except for the problem that when I try to edit on of the form's row, other 
> form's row with same Id also appears to be edited. How should i stop it?
> my controller:
> def CommitmentBrowse_rep():
>     rows=db(db.Commitments.Account==session.id).select()
>     commtot=0
>     compen=0
>     comfull=0
>     for row in rows:
>         commtot=commtot+int(row.Amount)
>         if row.pending:
>             compen=compen+int(row.Amount)
>         else:
>             comfull=comfull+int(row.Amount)
>             
>     rows=db(db.Transaction_Master.Account==session.id).select()
>     netdue=0
>     for row in rows:
>         netdue=netdue+int(row.Net_Due)
>         
>     pay=0
>     rows=db(db.Payments.Account==session.id).select()
>     for row in rows:
>         pay=pay+int(row.Amount)
>     a=[]
>     b=[]
>     count=0
>     a.append([TH('Due Amount'),TH('Commited Amount'),TH('Commitment 
> Fulfilled'),TH('Commitment Pending'),TH('Uncommitted Amount'),TH('Payments 
> Received')])
>     a.append([netdue,commtot,comfull,compen,pay])
>     COMMITMENTS=SQLFORM.grid(db.Commitments.Account==session.id
> ,user_signature=False)
>     PAYMENTS=SQLFORM.grid(db.Payments.Account==session.id
> ,user_signature=False)
>     return dict(COMMITMENTS=COMMITMENTS,PAYMENTS=PAYMENTS,SUMMARY=TABLE(a))
>

Reply via email to