Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 tables in one page using different tablesorter widgets #584

Closed
newbiezuki opened this issue Apr 18, 2014 · 2 comments
Closed

2 tables in one page using different tablesorter widgets #584

newbiezuki opened this issue Apr 18, 2014 · 2 comments

Comments

@newbiezuki
Copy link

hi mottie.

i have one page with 2 different tables. One table i have already configured it to have search filter and scroller. The other table i want to configure it to have a scroller but thats not happening.

SCRIPT

    <link rel="stylesheet" type="text/css" media="all" href="css/theme.blue.css">
<script type="text/javascript" src="js/jquery 1.10.2.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.10.4.custom.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.10.4.custom.js"></script>
<script src="js/jquery.tablesorter.js"></script>
<script src="js/jquery.tablesorter.widgets.js"></script>
<script src="js/widget-scroller.js"></script>
<script id="js">$(function() {
    var $table = $('.seating-contact-table').tablesorter({
    theme: 'blue',
    widgets: ["filter", "scroller"],
    widgetOptions : {

        scroller_height: 100,
        filter_columnFilters: false,
        filter_saveFilters : true,
        filter_reset: '.reset',
    }
});
$.tablesorter.filter.bindSearch( $table, $('.search') );
    });
</script>
<script>$(function() {
    var $table = $('.seating-guest-table').tablesorter({
    theme: 'blue',
    widgets: [ "scroller"],
    widgetOptions : {

        scroller_height: 100,
    }
});
    });
</script>

HTML

  <div id="seating-contact"><input class="search selectable" type="search"           
  placeholder="Search" data-column="all">
  <table class="seating-contact-table">
<thead>
    <tr>
        <th>Name</th>
    </tr>
</thead>
<tbody>
    <?php
                    require "connection.php";

                    $check = mysql_query("SELECT   
      salutation,fname,lname FROM contact") or die(mysql_error());
                    if(mysql_num_rows($check) > 0)
                    {
                        while($rows = mysql_fetch_array($check))
                        {
                            $salutation = $rows['salutation'];
                            $firstname = $rows['fname'];
                            $lastname = $rows['lname'];

                            echo 
                            "<tr>
                                <td>$salutation $firstname 
    $lastname</td>
                            </tr>";
                        }
                    }   
                    else
                        {
                            echo 
                            "<tr>
                                <td>Contact Database is empty.</td>
                            </tr>";
                        }
                ?>
</tbody>

 </table></div>

   <div class="seating-guest" >
    <table class="seating-guest-table" >
        <thead>
            <th>Name</th>
        </thead>
        <tbody>
                <?php
                    require "connection.php";

                    $check = mysql_query("SELECT      
  salutation,fname,lname FROM contact") or die(mysql_error());
                    if(mysql_num_rows($check) > 0)
                    {
                        while($row = mysql_fetch_array($check))
                        {
                            $salutation = $row['salutation'];
                            $firstname = $row['fname'];
                            $lastname = $row['lname'];

                            echo 
                            "<tr>
                                <td>$salutation $firstname              
     $lastname</td>
                            </tr>";
                        }
                    }   
                    else
                        {
                            echo 
                            "<tr>
                                <td>Choose an Event from the list.</td>
                            </tr>";
                        }
                ?>
            </tbody>
    </table>
</div>

PROBLEM:

the table using 2 widgets: search filter not working.
table using scroller : table doesnt configure as in no table at all just the words.

am i doing something wrong?

@newbiezuki newbiezuki changed the title 2 tables using tablesorter widgets 2 tables in one page using different tablesorter widgets Apr 18, 2014
@Mottie
Copy link
Owner

Mottie commented Apr 18, 2014

Hi @newbiezuki!

Actually it looks like an issue with the scroller widget - it doesn't work with the latest filter widget code.

I haven't updated the scroller widget in a while, and it has a bunch of other issues that haven't been resolved. So for now, don't use it. In the next update (v2.16), I'll at least make it usable again; but I'm going to completely rewrite it eventually.

@Mottie
Copy link
Owner

Mottie commented Apr 18, 2014

Hey @newbiezuki!

Please test out this updated scroller widget version for me (demo):

https://github.com/Mottie/tablesorter/blob/working/js/widgets/widget-scroller.js

I haven't push this update out to the master branch yet. I hope to do that this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants