In my Aurelia project I have a hidden table at the top (whose header I clone), which I want to use in order to display its header (fixed position) when the original one is scrolled out of view. The problem I have is that the click.delegate of the cloned header is not calling the method in my typescript.
view.html
<table id="fixed-header"></table>
<table scrollable-header id="tableWithScrollableHeader" if.bind="something">
<thead>
<tr>
<th width="55%">
</th>
<th repeat.for="item of listOfItems">
${item.name}
<div>
<label click.delegate="doSomething(item.id)">
<span>${item.date}</span>
<i class="glyphicon glyphicon-pencil"></i>
</label>
</div>
</th>
</tr>
</thead>
<tbody repeat.for="itemOfBody of listOfItemsForBody">
// irreleveant code that displays the table's body
</tbody>
</table>
The scrollable-header
is a custom attribute I created which clones the header of my table and appends it to the hidden table, using
var $tableHeader = $("#tableWithScrollableHeader > thead");
var $clonedHeader = $tableHeader.clone(true, true);
var $fixedHeaderTable = $("#fixed-header").append($clonedHeader);
Then on scroll it determines whether to display the original table's header or the fixed positioned one. (similar to this answer)
It displays the fixed header correctly when the original one's out of view but clicking the label does not do anything.
I've also tried replacing click.delegate
with click.trigger
but hasn't made any difference.