sqlform.grid edit view back button

192 views
Skip to first unread message

Yebach

unread,
Aug 19, 2014, 6:13:55 AM8/19/14
to web...@googlegroups.com
Hello

I have to create multiple sqlform.grids in my page

i used bootstrap tabs to load different htmls with different controller functions (each for every grid)

It works ok and does the trick except when I edit record I and click the back button the link is not back to the page it was so I cannot see tabs anymore

but after clicking my back button I am send to http://127.0.0.1:8080/iRazpored/settings/turnusi 

I hope I am clear enough.
Also when I am on edit view tabs are not shown since the url is http://127.0.0.1:8080/iRazpored/settings/turnusi/edit/shifts
Is is possible to set the back button address or is there any other way around it?

Thank you

this is my html

my main view

{{ extend 'layout.html' }}
{{include 'web2py_ajax.html'}}
<script>
$(document).ready(function() {
$('#worker_w_note').width(200).height(75);
//glyphicon glyphicon-edit
$('#workers').load('workers.html');
$('#turnusi').load('turnusi.html');
});
</script>

<style>
.affix {
top: 60px;
}
.input-group {
width: 100%;
}
.row {
margin-bottom: 10px;
}
.sectionHeader {
margin-bottom: 0;
}
</style>

<div class="tabbable" style="margin-bottom: 18px;">
     <ul class="nav nav-tabs">
            <li class="active"><a href="#workers" data-toggle="tab">Zaposleni</a></li>
            <li class=""><a href="#turnusi" data-toggle="tab">Turnusi</a></li>
          </ul>
    <div class="col-md-12">
          <div class="tab-content" style="padding-bottom: 9px; border-bottom: 1px solid #ddd;">
            <div class="tab-pane active" id="workers">
            </div>
            <div class="tab-pane" id="turnusi">
            </div>
          </div>
    </div>
</div>​



And the two htmls for my sqlform.grid

{{extend 'layout.html'}}
{{include 'web2py_ajax.html'}}
<style>
.affix {
top: 60px;
}
.input-group {
width: 100%;
}
.row {
margin-bottom: 10px;
}
.sectionHeader {
margin-bottom: 0;
}
</style>
<body>
<div class="col-md-12">
{{=grid_shifts}}

</div>
</body>


{{extend 'layout.html'}}
{{'web2py_ajax.html'}}

<script>
</script>

<style>
.affix {
top: 60px;
}
.input-group {
width: 100%;
}
.row {
margin-bottom: 10px;
}
.sectionHeader {
margin-bottom: 0;
}
</style>
<body>
<div class="col-md-12">
{{=grid_workers}}

</div>
</body>

Niphlod

unread,
Aug 19, 2014, 3:06:56 PM8/19/14
to web...@googlegroups.com
1. if you need multiple forms in one single page, you should use different formnames
2. you're loading the "fragment" not using LOAD (nor $.web2py.component), so links aren't trapped correctly

Once you fix those, there shouldn't be any outstanding issues.

Vid Ogris

unread,
Aug 19, 2014, 3:17:25 PM8/19/14
to web...@googlegroups.com
How do I work with LOAD?


--
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/08shPqNPPdw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Lep pozdrav 

Vid Ogris


Niphlod

unread,
Aug 19, 2014, 3:25:31 PM8/19/14
to web...@googlegroups.com
read it on the book (http://web2py.com/books/default/chapter/29/12/components-and-plugins) . Instead of loading tab fragments manually by javascript, you can let web2py facilities do it for you.
Reply all
Reply to author
Forward
0 new messages