In a view with tabs I have the following tab-pane:
{{if vevent.event_list:}}
<div id="eventlist" class="tab-pane">
<div class="row-fluid">
<div class="span12">
{{=LOAD('calendar','eventList.load',args=int(organization.nodeID),ajax=True,target='eventlist')}}
</div><!-- /span -->
</div><!-- /row -->
</div> <!-- /relatednames -->
{{pass}}
In the eventList function I set the view to: calendar/eventList.html
This view contains the following link:
{{=A(XML("View details »"),_class="btn btn-primary btn-mini",
_onclick="javascript:openwindow('%s','vcardwindow',1028,576)"
%URL('event',args=row.id))}}
... which is rendered as follows:
<a
onclick="javascript:openwindow('/bootstrap/calendar/event.load/1','vcardwindow',1028,576)"
class="btn btn-primary btn-mini">View details »</a>
The following event function renders a table in the generic view:
def event():
row=db(db.EventList.id==request.args(0)).select(db.EventList.ALL)
return dict(row=row)
Since I want the event to be rendered in the following view:
{{if row:}}
<div class="modal" id="myModal">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3>{{=row.summary}}</h3>
<p>
{{=db.EventList.startDate.formatter(row.startDate)}}
{{if row.endDate:}} - {{=db.EventList.endDate.formatter(row.endDate)}}
{{pass}}
</p>
</div>
<div class="modal-body">
<p>{{=row.description}}</p>
</div>
<div class="modal-footer">
<a class="btn" data-dismiss="modal">Close</a>
</div>
</div>
{{pass}}
I rewrote the event function:
def event():
response.view='calendar/event.html'
row=db(db.EventList.id==request.args(0)).select(db.EventList.ALL)
return dict(row=row)
However, this result in an error:
Traceback (most recent call last):
File "/Library/Python/2.5/site-packages/web2py/gluon/restricted.py", line
205, in restricted
exec ccode in environment
File
"/Library/Python/2.5/site-packages/web2py/applications/bootstrap/views/calendar/event.html",
line 85, in <module>
AttributeError: 'Rows' object has no attribute 'summary'
I don't understand why.
Kind regards,
Annet