Team
I am redirecting to a view using {{redirect(URL('ShowData')) the menu is
not working as both the views got "extend layout.hml" it is overwriting and
blocking the menu to work
I have a menu with 5 menu items in it, when the first view loads it works
fine but after redirecting to another view the menu is not working
please help me how can I overcome this issue
Code
====
Controller
=======
define DisplayData():
##code written to get data from database for the user to add and edit a
record
View - Sample/DisplayData
================
{{extend 'layout.html'}}
Code written to load the data in html controls and to allow user to add a
new
used ajax to call controller to insert new records to database after
clicking on "Submit" button
ajax('{{=URL('insert_data)}}',['name','dept_id','sal'],'target');
Controller
=======
def insert_data()
## code written to insert records and show a message to user that tells how
many records inserted
View - Sample/insert_data
===============
Sample/insert_data.html
code written to show user how many records inserted and also to display
grid, calling that grid in javascript
<head>
<link rel="stylesheet"
href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
</head>
<script>
$(document).ready(function() {
$("#dialog-message").dialog({
modal: true,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
{{redirect(URL(''ShowData''))}}
}
}
});
});
</script>
<div id="dialog-message" title="HCES LoE-Tracking" style="display:none">
<p>{{=i}} Records Inserted</p>
</div>
Controller - ShowData
====================
define ShowData():
## code written to get records
......
......
grid =
SQLFORM.grid(rows,fields=displayFields,headers=displayHeaders,deletable=False,create=False,editable=False,details=True,csv=True,paginate=20)
return dict(grid=grid)
View- ShowData
=============
{{extend 'layout.html'}}
{{=grid}}
after redirecting i am the results of 3 views (DisplayData, inserdata and
ShowData) as {{extend 'layout.html'}} is used in DisplayData and ShowData i
am guessing the menu is overwritten and not allowing to user to work with
menu
i tried removing {{extend 'layout.html'}} in ShowData as this view contains
a grid the styles are not working when we use paging, search, export csv
etc...
is there a way to just show output of "ShowData" without including the
results of views DisplayData and inserdata , just move to ShowData.
please suggest how can i overcome this issue
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.