Re: [web2py] Re: How to insert different grid elements in tab panels?

2016-03-19 Thread Ron Chatterjee
Thank you! that works

On Friday, March 18, 2016 at 9:51:31 AM UTC-4, Massimiliano wrote:
>
> Try to give a each grid a uniq formname:
>
> SQLFORM.grid(db.post, formname=‘grid_post’)
>
> SQLFORM.grid(db.post, formname=‘grid_comments’)
>
> On Wed, Mar 16, 2016 at 1:25 AM, Ron Chatterjee  > wrote:
>
>> Basically, I go to panel one and "view" the grid element. And if I click 
>> on "back" button it takes me to panel2 content even though it says panel1. 
>> And vice versa.
>>
>>
>> On Tuesday, March 15, 2016 at 8:21:59 PM UTC-4, Ron Chatterjee wrote:
>>>
>>> I used the LOAD but seems to be the problem still there. See attached pic
>>>
>>>
>>> My Model
>>>
>>> db.define_table('post',
>>> Field("title", "string", length=128, default=""),
>>> Field("contents", "text", length=512, default=""),
>>> Field("created_on", "date", default=None),
>>> )
>>>  
>>> if not db(db.post).count():
>>> from gluon.contrib.populate import populate
>>> populate(db.post,25)
>>>
>>> db.define_table('comments',
>>> Field("title", "text", length=128, default=""),
>>> Field("contents", "string", length=512, default=""),
>>> Field("created_on", "date", default=None),
>>> )
>>>  
>>> if not db(db.comments).count():
>>> from gluon.contrib.populate import populate
>>> populate(db.comments,25)
>>>
>>>
>>>
>>> Controller:
>>>
>>> def first_action():
>>> grid1 = SQLFORM.grid(db.post)
>>> return dict(grid1 = grid1)
>>>
>>> def second_action():
>>> grid2 = SQLFORM.grid(db.comments)
>>> return dict(grid2 = grid2)
>>>
>>>
>>> def tab_panel():
>>> return locals()
>>>
>>>
>>>
>>> View:
>>>
>>> {{extend 'layout.html'}}
>>>
>>> 
>>>   My Dashboard
>>>   
>>> My 
>>> Projects
>>> My Files
>>> Menu 2
>>> Menu 3
>>>   
>>>
>>>   
>>> 
>>>   {{=LOAD('default','first_action.load',ajax=True)}}
>>> 
>>> 
>>>   
>>>   {{=LOAD('default','second_action.load',ajax=True)}}
>>> 
>>> 
>>>   Menu 2
>>>   Sed ut perspiciatis unde omnis iste natus error sit voluptatem 
>>> accusantium doloremque laudantium, totam rem aperiam.
>>> 
>>> 
>>>   Menu 3
>>>   Eaque ipsa quae ab illo inventore veritatis et quasi architecto 
>>> beatae vitae dicta sunt explicabo.
>>> 
>>>   
>>> 
>>>
>>>
>>>
>>> On Wednesday, March 2, 2016 at 4:24:26 PM UTC-5, Ron Chatterjee wrote:

 Thank you Val. Appreciate the help.

 On Wednesday, March 2, 2016 at 1:51:58 PM UTC-5, Val K wrote:
>
> As I know it's impossible to have 2 "static" (not ajax)  SQLFORM.grids 
> at the same page, because each of them will treat request.args  as its 
> own 
>
> Use {=LOAD(... , ajax=True)} 
>
> And I think  you have to have different controllers to process them or 
> one controller that will return different results depends on "whose 
> requests" - return dict(grid= grid1)  or  return dict(grid= grid2)  not 
> both!
>
>
> On Wednesday, March 2, 2016 at 8:12:49 PM UTC+3, Ron Chatterjee wrote:
>>
>>
>> If I have two independent grid, when I search in one grid, it gets 
>> redirected to the other tab. And I noticed this with other tab panel as 
>> well.  
>>
>>
>>
>> 
>>   
>> My Projects
>> My Payments
>> My Contacts
>>   
>>   
>> 
>>   {{=grid1}}
>>   
>>   
>> {{=grid2}}
>>   
>>   
>> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed 
>> diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
>> volutpat.
>> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed 
>> diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
>> volutpat.
>> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed 
>> diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
>> volutpat.
>>   
>> 
>>
>> 
>> $( "#tabs" ).tabs();
>> 
>>
>> -- 
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Massimiliano
>

-- 
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 

Re: [web2py] Re: How to insert different grid elements in tab panels?

2016-03-18 Thread Massimiliano
Try to give a each grid a uniq formname:

SQLFORM.grid(db.post, formname=‘grid_post’)

SQLFORM.grid(db.post, formname=‘grid_comments’)

On Wed, Mar 16, 2016 at 1:25 AM, Ron Chatterjee 
wrote:

> Basically, I go to panel one and "view" the grid element. And if I click
> on "back" button it takes me to panel2 content even though it says panel1.
> And vice versa.
>
>
> On Tuesday, March 15, 2016 at 8:21:59 PM UTC-4, Ron Chatterjee wrote:
>>
>> I used the LOAD but seems to be the problem still there. See attached pic
>>
>>
>> My Model
>>
>> db.define_table('post',
>> Field("title", "string", length=128, default=""),
>> Field("contents", "text", length=512, default=""),
>> Field("created_on", "date", default=None),
>> )
>>
>> if not db(db.post).count():
>> from gluon.contrib.populate import populate
>> populate(db.post,25)
>>
>> db.define_table('comments',
>> Field("title", "text", length=128, default=""),
>> Field("contents", "string", length=512, default=""),
>> Field("created_on", "date", default=None),
>> )
>>
>> if not db(db.comments).count():
>> from gluon.contrib.populate import populate
>> populate(db.comments,25)
>>
>>
>>
>> Controller:
>>
>> def first_action():
>> grid1 = SQLFORM.grid(db.post)
>> return dict(grid1 = grid1)
>>
>> def second_action():
>> grid2 = SQLFORM.grid(db.comments)
>> return dict(grid2 = grid2)
>>
>>
>> def tab_panel():
>> return locals()
>>
>>
>>
>> View:
>>
>> {{extend 'layout.html'}}
>>
>> 
>>   My Dashboard
>>   
>> My
>> Projects
>> My Files
>> Menu 2
>> Menu 3
>>   
>>
>>   
>> 
>>   {{=LOAD('default','first_action.load',ajax=True)}}
>> 
>> 
>>
>>   {{=LOAD('default','second_action.load',ajax=True)}}
>> 
>> 
>>   Menu 2
>>   Sed ut perspiciatis unde omnis iste natus error sit voluptatem
>> accusantium doloremque laudantium, totam rem aperiam.
>> 
>> 
>>   Menu 3
>>   Eaque ipsa quae ab illo inventore veritatis et quasi architecto
>> beatae vitae dicta sunt explicabo.
>> 
>>   
>> 
>>
>>
>>
>> On Wednesday, March 2, 2016 at 4:24:26 PM UTC-5, Ron Chatterjee wrote:
>>>
>>> Thank you Val. Appreciate the help.
>>>
>>> On Wednesday, March 2, 2016 at 1:51:58 PM UTC-5, Val K wrote:

 As I know it's impossible to have 2 "static" (not ajax)  SQLFORM.grids
 at the same page, because each of them will treat request.args  as its own

 Use {=LOAD(... , ajax=True)}

 And I think  you have to have different controllers to process them or
 one controller that will return different results depends on "whose
 requests" - return dict(grid= grid1)  or  return dict(grid= grid2)  not
 both!


 On Wednesday, March 2, 2016 at 8:12:49 PM UTC+3, Ron Chatterjee wrote:
>
>
> If I have two independent grid, when I search in one grid, it gets
> redirected to the other tab. And I noticed this with other tab panel as
> well.
>
>
>
> 
>   
> My Projects
> My Payments
> My Contacts
>   
>   
>
>   {{=grid1}}
>   
>   
> {{=grid2}}
>   
>   
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
> volutpat.
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
> volutpat.
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
> volutpat.
>   
> 
>
> 
> $( "#tabs" ).tabs();
> 
>
> --
> 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.
>



-- 
Massimiliano

-- 
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] Re: How to insert different grid elements in tab panels?

2016-03-15 Thread Ron Chatterjee
Basically, I go to panel one and "view" the grid element. And if I click on 
"back" button it takes me to panel2 content even though it says panel1. And 
vice versa.

On Tuesday, March 15, 2016 at 8:21:59 PM UTC-4, Ron Chatterjee wrote:
>
> I used the LOAD but seems to be the problem still there. See attached pic
>
>
> My Model
>
> db.define_table('post',
> Field("title", "string", length=128, default=""),
> Field("contents", "text", length=512, default=""),
> Field("created_on", "date", default=None),
> )
>  
> if not db(db.post).count():
> from gluon.contrib.populate import populate
> populate(db.post,25)
>
> db.define_table('comments',
> Field("title", "text", length=128, default=""),
> Field("contents", "string", length=512, default=""),
> Field("created_on", "date", default=None),
> )
>  
> if not db(db.comments).count():
> from gluon.contrib.populate import populate
> populate(db.comments,25)
>
>
>
> Controller:
>
> def first_action():
> grid1 = SQLFORM.grid(db.post)
> return dict(grid1 = grid1)
>
> def second_action():
> grid2 = SQLFORM.grid(db.comments)
> return dict(grid2 = grid2)
>
>
> def tab_panel():
> return locals()
>
>
>
> View:
>
> {{extend 'layout.html'}}
>
> 
>   My Dashboard
>   
> My 
> Projects
> My Files
> Menu 2
> Menu 3
>   
>
>   
> 
>   {{=LOAD('default','first_action.load',ajax=True)}}
> 
> 
>   
>   {{=LOAD('default','second_action.load',ajax=True)}}
> 
> 
>   Menu 2
>   Sed ut perspiciatis unde omnis iste natus error sit voluptatem 
> accusantium doloremque laudantium, totam rem aperiam.
> 
> 
>   Menu 3
>   Eaque ipsa quae ab illo inventore veritatis et quasi architecto 
> beatae vitae dicta sunt explicabo.
> 
>   
> 
>
>
>
> On Wednesday, March 2, 2016 at 4:24:26 PM UTC-5, Ron Chatterjee wrote:
>>
>> Thank you Val. Appreciate the help.
>>
>> On Wednesday, March 2, 2016 at 1:51:58 PM UTC-5, Val K wrote:
>>>
>>> As I know it's impossible to have 2 "static" (not ajax)  SQLFORM.grids 
>>> at the same page, because each of them will treat request.args  as its own 
>>>
>>> Use {=LOAD(... , ajax=True)} 
>>>
>>> And I think  you have to have different controllers to process them or 
>>> one controller that will return different results depends on "whose 
>>> requests" - return dict(grid= grid1)  or  return dict(grid= grid2)  not 
>>> both!
>>>
>>>
>>> On Wednesday, March 2, 2016 at 8:12:49 PM UTC+3, Ron Chatterjee wrote:


 If I have two independent grid, when I search in one grid, it gets 
 redirected to the other tab. And I noticed this with other tab panel as 
 well.  



 
   
 My Projects
 My Payments
 My Contacts
   
   
 
   {{=grid1}}
   
   
 {{=grid2}}
   
   
 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam 
 nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
 volutpat.
 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam 
 nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
 volutpat.
 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam 
 nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
 volutpat.
   
 

 
 $( "#tabs" ).tabs();
 



-- 
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] Re: How to insert different grid elements in tab panels?

2016-03-15 Thread Ron Chatterjee
I used the LOAD but seems to be the problem still there. See attached pic


My Model

db.define_table('post',
Field("title", "string", length=128, default=""),
Field("contents", "text", length=512, default=""),
Field("created_on", "date", default=None),
)
 
if not db(db.post).count():
from gluon.contrib.populate import populate
populate(db.post,25)

db.define_table('comments',
Field("title", "text", length=128, default=""),
Field("contents", "string", length=512, default=""),
Field("created_on", "date", default=None),
)
 
if not db(db.comments).count():
from gluon.contrib.populate import populate
populate(db.comments,25)



Controller:

def first_action():
grid1 = SQLFORM.grid(db.post)
return dict(grid1 = grid1)

def second_action():
grid2 = SQLFORM.grid(db.comments)
return dict(grid2 = grid2)


def tab_panel():
return locals()



View:

{{extend 'layout.html'}}


  My Dashboard
  
My 
Projects
My Files
Menu 2
Menu 3
  

  

  {{=LOAD('default','first_action.load',ajax=True)}}


  
  {{=LOAD('default','second_action.load',ajax=True)}}


  Menu 2
  Sed ut perspiciatis unde omnis iste natus error sit voluptatem 
accusantium doloremque laudantium, totam rem aperiam.


  Menu 3
  Eaque ipsa quae ab illo inventore veritatis et quasi architecto 
beatae vitae dicta sunt explicabo.

  




On Wednesday, March 2, 2016 at 4:24:26 PM UTC-5, Ron Chatterjee wrote:
>
> Thank you Val. Appreciate the help.
>
> On Wednesday, March 2, 2016 at 1:51:58 PM UTC-5, Val K wrote:
>>
>> As I know it's impossible to have 2 "static" (not ajax)  SQLFORM.grids at 
>> the same page, because each of them will treat request.args  as its own 
>>
>> Use {=LOAD(... , ajax=True)} 
>>
>> And I think  you have to have different controllers to process them or 
>> one controller that will return different results depends on "whose 
>> requests" - return dict(grid= grid1)  or  return dict(grid= grid2)  not 
>> both!
>>
>>
>> On Wednesday, March 2, 2016 at 8:12:49 PM UTC+3, Ron Chatterjee wrote:
>>>
>>>
>>> If I have two independent grid, when I search in one grid, it gets 
>>> redirected to the other tab. And I noticed this with other tab panel as 
>>> well.  
>>>
>>>
>>>
>>> 
>>>   
>>> My Projects
>>> My Payments
>>> My Contacts
>>>   
>>>   
>>> 
>>>   {{=grid1}}
>>>   
>>>   
>>> {{=grid2}}
>>>   
>>>   
>>> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam 
>>> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
>>> volutpat.
>>> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam 
>>> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
>>> volutpat.
>>> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam 
>>> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
>>> volutpat.
>>>   
>>> 
>>>
>>> 
>>> $( "#tabs" ).tabs();
>>> 
>>>
>>>

-- 
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] Re: How to insert different grid elements in tab panels?

2016-03-02 Thread Ron Chatterjee
Thank you Val. Appreciate the help.

On Wednesday, March 2, 2016 at 1:51:58 PM UTC-5, Val K wrote:
>
> As I know it's impossible to have 2 "static" (not ajax)  SQLFORM.grids at 
> the same page, because each of them will treat request.args  as its own 
>
> Use {=LOAD(... , ajax=True)} 
>
> And I think  you have to have different controllers to process them or one 
> controller that will return different results depends on "whose requests" - 
> return dict(grid= grid1)  or  return dict(grid= grid2)  not both!
>
>
> On Wednesday, March 2, 2016 at 8:12:49 PM UTC+3, Ron Chatterjee wrote:
>>
>>
>> If I have two independent grid, when I search in one grid, it gets 
>> redirected to the other tab. And I noticed this with other tab panel as 
>> well.  
>>
>>
>>
>> 
>>   
>> My Projects
>> My Payments
>> My Contacts
>>   
>>   
>> 
>>   {{=grid1}}
>>   
>>   
>> {{=grid2}}
>>   
>>   
>> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam 
>> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
>> volutpat.
>> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam 
>> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
>> volutpat.
>> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam 
>> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
>> volutpat.
>>   
>> 
>>
>> 
>> $( "#tabs" ).tabs();
>> 
>>
>>

-- 
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] Re: How to insert different grid elements in tab panels?

2016-03-02 Thread Val K
As I know it's impossible to have 2 "static" (not ajax)  SQLFORM.grids at 
the same page, because each of them will treat request.args  as its own 


On Wednesday, March 2, 2016 at 8:12:49 PM UTC+3, Ron Chatterjee wrote:
>
>
> If I have two independent grid, when I search in one grid, it gets 
> redirected to the other tab. And I noticed this with other tab panel as 
> well.  
>
>
>
> 
>   
> My Projects
> My Payments
> My Contacts
>   
>   
> 
>   {{=grid1}}
>   
>   
> {{=grid2}}
>   
>   
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam 
> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
> volutpat.
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam 
> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
> volutpat.
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam 
> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
> volutpat.
>   
> 
>
> 
> $( "#tabs" ).tabs();
> 
>
>

-- 
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.