I am working on a timetable app using jQuery UI tab.

This is the timetable view:

<!-- Tabs -->
 <h2 class="demoHeaders">Lesrooster</h2>
   <div id="tabs">
      <ul>
        <li><a href="{{=URL('classtimes',args=[1])}}">Monday</a></li>
         <li><a href="{{=URL('classtimes',args=[2])}}">Tuesday</a></
li>
         <li><a href="{{=URL('classtimes',args=[3])}}">Wednesday</a></
li>
         <li><a href="{{=URL('classtimes',args=[4])}}">Thursday</a></
li>
         <li><a href="{{=URL('classtimes',args=[5])}}">Friday</a></li>
          <li><a href="{{=URL('classtimes',args=[6])}}">Saturday</a></
li>
          <li><a href="{{=URL('classtimes',args=[7])}}">Sunday</a></
li>
           <li><a href="{{=URL('classtimes',args=['week'])}}">Week</
a></li>
         </ul>
    </div> <!-- tabs -->


This the controller:

def timetable():
    return dict()

def classtimes():
    if request.args(0)=='week':
        weekday='all'
        rows=db(db.lesrooster.bedrijf_id==1).select(db.lesrooster.ALL,
\
orderby=db.lesrooster.dag_id|db.lesrooster.tijd)
    else:
        weekday=[]
 
rows=db((db.lesrooster.bedrijf_id==1)&(db.lesrooster.dag_id==request.args(0))).select(db.lesrooster.ALL
\
,orderby=db.lesrooster.tijd)
    return dict(rows=rows)

The classtimes view is a table based view.

This all works, what I don't get to work is the selected tab being
today's tab, i.e. when today is Friday, Friday's classes should be
displayed in the Friday tab.

I hope one of you will be able to help me solve this problem.

Kind regards,

Annet

Reply via email to