Problems with .delegate() on table populated with .tmpl()

Problems with .delegate() on table populated with .tmpl()

Hi all,

I'm using jQuery 1.4.4 and I can't understand where I'm doing wrong, I'm simply populating all the rows of a table with template function, so far so good, but I cant delegate the "hover" (and click and all the events) event on a row or a cell.

I've tried to put the .delegate() code also in the footer of my page but nothing.

Do you know there are some problems?


My code actually is:

  1. <script id="listTemplate" type="text/x-jquery-tmpl">
  2.       <tr>
  3.             <td>${item}</td>
  4.       </tr>
  5. </script>
  1. <table id="list-table">
  2.       <tr>
  3.             <th>Item</th>
  4.       </tr>

  5.      <tbody id="list-grid"></tbody>
  6. </table>
  1. $("#list-table").delegate("#list-grid tr", "hover", function() {
  2.       console.log('Some text here');
  3. });