I have a custom binding that I created with the help of How to refresh Footable that is bound with Knockout?.
I have one page where the binding is not called when the page is first loaded, but is called if I refresh the page. (Push F5) For all of the other pages I have, the binding work as expected and I've never seen this behavior anyplace else.
What I've noticed so far:
- As far as I can tell, the data is the same in the View Model
- When I put a break point in the init function of the binding source code, the break point is hit on the times that it works. When it doesn't work, the break point is never hit. I really need the preprocess to be called, but I've been putting the break point in the init because it's at the top of the file. I get the same results if I put the break point in the preprocess function.
- When I put a break point outside and above the init function, the break point is hit every time. Meaning the binding is created
- This is for a table, when I put a span above the table and display the $data with toJSON(), the data looks the same for when it works or not.
I have tried to create a Plunk to demonstrate this, but I'm not having any luck. (Meaning, every time I try to simplify the scenario, it always works)
Here's what the html looks like: (The data-bind looks the same in both cases)
<tbody data-bind="footable: items">
<tr class="footable-even" style="display: table-row;">
<td class="footable-visible footable-first-column"><span class="footable-toggle"></span></td>
<td class="footable-visible"></td>
<td class="footable-visible"></td>
<td class="footable-visible footable-last-column"></td>
</tr>
</tbody>
I'm testing with a result set that only has one row.
So, what would cause a binding to not be called? Where else could I put a break point to see what is going on?