0

i am using jquery-ui tabs to load 3 different views to user, however the problem is that user is not allowed to see all the 3 views all the time. so my question is how to dynamically remove tab if it doesn't contain any content. also another problem is that the tab height is not expanding to fit content.

php:

 echo '<div id="tabs">';
             echo '<ul><li><a href="#tabs-1">Author</a></li>';
             echo '<li><a href="#tabs-2">Organizer</a></li>';
              echo '<li><a href="#tabs-3">Reviewer</a></li></ul>';
            while ($r = mysql_fetch_assoc($get_role)) {
                $role = $r['role'];
                if ($role == 'author') {
                    echo "<div id='tabs-1'>";
                    AuthorView($member_id, $conference_id, $start, $end, $today);
                    echo "</div>";
                } else if ($role == 'organizer') {
                    echo "<div id='tabs-2'>";
                    OrganizerView($conference_id, $end);
                    echo "</div>";
                } else if ($role == 'reviewer') {
                    echo "<div id='tabs-3'>";
                    ReviewerView($member_id, $conference_id, $start, $end, $today);
                    echo "</div>";
                }
            }
            echo "</div>";

PS: AuthorView, ReviewerView, OrganizerView are php functions which creates each of the views

Samer El Gendy
  • 1,683
  • 2
  • 23
  • 45

1 Answers1

0

For the problem about tab height not fitting content, have a look at this post :

jQuery UI Tabs - Automatic Height

And why dont you make a global function that will hide or not the tabs depending on a return of XxxxView functions ?

Community
  • 1
  • 1
Jerska
  • 11,722
  • 4
  • 35
  • 54