You're not going to believe this.  I was reading over my post to check
for clarity as I always do and noticed something out of place.  The
{{pass}} statement for the loop is after </tbody>, effectively
creating several 'ends' to the body.  I moved the pass statement up
and it's working, so disregard this post.

On Sep 13, 3:15 am, Chris S <[email protected]> wrote:
> I've been reading about the different table sorting methods and it
> seems DataTables is fairly highly recommended around here.  I'm wanted
> to try using it but I'm have a problem with it.  Currently, I only get
> the 'search' and 'perpage' fields at the top of my table, neither of
> which seem to work.  The search doesn't narrow things down and the per/
> page list doesn't limit the table size.
>
> I'm starting to think it's because the table is built in a for loop,
> is that not allowed?  I've tried making sure dataTables isn't run
> until after the window loads but that doesn't seem to help.  I'm on on
> the right path?  Can any dataTables users with success tell me what
> I'm missing?
>
> --------dataTables.html (imported into layout.html)-----------
> <script type="text/javascript" src="{{=URL
> (r=request,c='static',f='dataTables/jquery.dataTables.min.js')}}"></
> script>
> <script type="text/javascript" src="{{=URL
> (r=request,c='static',f='dataTables/jquery.dataTables.js')}}"></
> script>
> --------------------------------------------------------------------------- 
> ----------
>
> -------View (extends layout.html) ----------------------------
> <div align=center>
> <table id="table_id">
>     <thead>
>         <tr class="tablehead">
>             <th>
>             <b>Name</b><br>
>             </th>
>
>             <th>
>             <b>Item Level<b><br>
>             </th>
>
>             <th>
>             <b>Recipe Level<b><br>
>             </th>
>
>             <th>
>             <b>Rarity<b><br>
>             </th>
>
>             <th>
>             <b>Reagents<b><br>
>             </th>
>         </tr>
>     </thead>
>     <tbody>
>         {{row='odd'}}
>         {{for Row in RecList:}}
>         {{if row=='even':}}
>          <tr class="tableroweven">
>         {{row='odd'}}
>         {{else:}}
>         <tr class="tablerowodd">
>         {{row='even'}}
>         {{pass}}
>             <td>
>             {{=Row['Name']}}
>             </td>
>
>             <td>
>             {{=Row['ItemLevel']}}
>             </td>
>
>             <td>
>             {{=Row['RecipeLevel']}}
>             </td>
>
>             <td>
>             {{=Row['Rarity']}}
>             </td>
>
>             <td>
>             {{=Row['Reagents']}}
>             </td>
>         </tr>
>     </tbody>
>     {{pass}}
> </table>
> <script>
> jQuery(window).load(function() {jQuery('#table_id').dataTable()});
> </script>
> --------------------------------------------
>
> I've tried removing the <tr class="xxx"> that's int he for loop and it
> didn't help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to