How can I do that? Load via Ajax?

2014-08-12 19:41 GMT+02:00 Massimo Di Pierro <massimo.dipie...@gmail.com>:

> You cannot have multiple grids in one page because they use the url args
> to set their parameters. Unless you load the grid separately via ajax.
>
>
> On Tuesday, 12 August 2014 02:10:38 UTC-5, Yebach wrote:
>>
>> Thanks for reply
>>
>> I get both grids but they are not in different tabs but both in the same
>> and in addition, when I open view or edit option I get double view for
>> one record?
>>
>>
>> 2014-08-11 16:58 GMT+02:00 Cliff Kachinske <cjk...@gmail.com>:
>>
>>> I would just use ajax or LOAD.
>>>
>>> If you really want to use grid, something like this might work.
>>>
>>> In the view:
>>> <div id=tab_0>
>>> {{=form_0}}
>>> </div>
>>>
>>>
>>> <div id=tab_1>
>>> {{=form_1}}
>>> </div>
>>>
>>>
>>> <div id=tab_...>
>>> {{=form_...}}
>>> </div>
>>>
>>> In the controller:
>>> def some_func():
>>>
>>>
>>>     form_0 = SQLFORM.grid(whatever)
>>>     form_1 = SQLFORM.grid(whatever_else)
>>>     form_... = SQLFORM.grod(yet_other)
>>>
>>>
>>> return dict(form_0=form_0, form_1=form_1, form_...=form_...)
>>>
>>>
>>>
>>> On Monday, August 11, 2014 10:03:56 AM UTC-4, Yebach wrote:
>>>>
>>>> Hello
>>>>
>>>> I am trying to create a view where I have tabs and each tab has its own
>>>> view.
>>>> All tabs are included into main view. lets call it settings.
>>>>
>>>> In settings there are tabs for user to insert workers into tables,
>>>> posts, etc etc. all the (un)necessary stuff.
>>>>
>>>> For each I would like to use SQLFORM.grid. It already works for
>>>> inserting workers, but how to add new ones??
>>>>
>>>> I guess in controller I have to create function for each table
>>>> (form.grid) and for each I have to create new view (html)??
>>>>
>>>> And what function to create for main view? - Basically it should show
>>>> data for workers but this way all I get is workers SQLform.grid
>>>>
>>>> Is this it even possible.
>>>>
>>>> Any guideliness would be nice
>>>>
>>>> Thank you
>>>>
>>>> some code
>>>>
>>>> main view
>>>>
>>>> <ul class="nav nav-tabs">
>>>> <li class="active"><a href="#zaposleni" data-toggle="tab">{{=T('Delavc
>>>> i')}}</a></li>
>>>>  <li><a href="#turnusi" data-toggle="tab">{{=T('Turnusi')}}</a></li>
>>>>  </ul>
>>>>
>>>> <div class="tab-content">
>>>> <div class="tab-pane active" id="visual">
>>>> {{include '../views/settings/workers.html'}}
>>>>  </div>
>>>> <div class="tab-pane" id="turnusi">
>>>> {{include '../views/settings/turnusi.html'}}
>>>>  </div>
>>>> </div>
>>>> <div>
>>>> <div class="col-md-2">
>>>> <div id="navVisual" data-spy="affix" data-offset-top="60">
>>>>  <ul class="nav nav-pills nav-stacked" style="margin-top: 10px;">
>>>> <li><a href="#SifrantDelavcev">{{=T('Delavci')}}</a></li>
>>>>  <li><a href="#unkn">{{=T('Turnusi')}}</a></li>
>>>> </ul>
>>>>  </div>
>>>> </div>
>>>> </div>
>>>>
>>>> My view for workers
>>>>
>>>> <div class="row" >
>>>> <div id="mainContainer" class="col-md-10">
>>>> <h4><b>{{=T('Šifrant delavcev')}}</b></h4>
>>>>  <div class="flash">{{=response.flash}}</div>
>>>> <div id="SifrantDelavcev" class="well well-sm">
>>>>  {{=grid}}
>>>> </div>
>>>> </div>
>>>> </div
>>>>
>>>> my view for turnusi
>>>>
>>>> <div class="row" >
>>>> <div id="mainContainer" class="col-md-10">
>>>>  <h4><b>{{=T('Šifrant turnusov')}}</b></h4>
>>>> <div class="flash">{{=response.flash}}</div>
>>>>  {{=grid}}
>>>> </div>
>>>> </div>
>>>>
>>>>
>>>> and for both i have fucntions in controller
>>>>
>>>>
>>>>  --
>>> 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 a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/
>>> topic/web2py/cB5pLIi9N6o/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> web2py+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Lep pozdrav
>>
>> Vid Ogris
>>
>>
>>   --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/cB5pLIi9N6o/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Lep pozdrav

Vid Ogris

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

Reply via email to