Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
[SOLVED] Problem with JQuery TableSorter

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
HugoRocha
Smarty n00b


Joined: 08 May 2012
Posts: 2

PostPosted: Tue May 08, 2012 7:42 pm    Post subject: [SOLVED] Problem with JQuery TableSorter Reply with quote

Hi all,

I have a small code in a tpl file with a table and a small script with the JQuery TableSorter initiation.

If i run the file directly on the browser the tablesorter works (without the {literal} tags ofc). But when I use the $smarty->display("expts.tpl"); it doesn't work. I tried with {ldelim},{rdelim} still doesn't work, I even replaced $("#myTable") for jQuery("#myTable") it still doesn't work.
Both pages source code seen on the browser are exactly the same though.

I have been searching but all topics and tips i found didn't work, I would be very grateful if anyone could give me a hand.

Code:

<script type="text/javascript" src="jquery-latest.js"></script>
<script type="text/javascript" src="jquery.tablesorter.js"></script>
           
<body>

  <table id="myTable" class="tablesorter" border="1">
  <thead>
    <tr>
      <th>Last Name</th>
      <th>First Name</th>
      <th>Email</th>
      <th>Due</th>
      <th>Web Site</th>
    </tr>
  </thead>
  <tbody>
  <tr>
    <td>Smith</td>
    <td>John</td>
    <td>jsmith@gmail.com</td>
    <td>$50.00</td>
    <td>http://www.jsmith.com</td>   
  </tr>
  <tr>
    <td>Bach</td>
    <td>Frank</td>
    <td>fbach@yahoo.com</td>
    <td>$50.00</td>
    <td>http://www.frank.com</td>
  </tr>
  <tr>
    <td>Doe</td>
    <td>Jason</td>
    <td>jdoe@hotmail.com</td>
    <td>$100.00</td>
    <td>http://www.jdoe.com</td>
  </tr>
  <tr>
    <td>Conway</td>
    <td>Tim</td>
    <td>tconway@earthlink.net</td>
    <td>$50.00</td>
    <td>http://www.timconway.com</td>
  </tr>
  </tbody>
  </table>
</body>

<script type="text/javascript">
{literal}
jQuery(document).ready(function()
    {
        jQuery("#myTable").tablesorter();
    }
);
{/literal}
</script>


Thanks in advance!


Last edited by HugoRocha on Tue May 08, 2012 8:57 pm; edited 1 time in total
Back to top
View user's profile Send private message
HugoRocha
Smarty n00b


Joined: 08 May 2012
Posts: 2

PostPosted: Tue May 08, 2012 8:57 pm    Post subject: Reply with quote

Managed to found the error, thanks anyway!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP