aCollapTable
aCollapTable copied to clipboard
Unable to get property 'parents' of undefined or null reference
Using IE11 and Chrome (Version 46.0.2490.86 m) and the Expand All, Collapse All button the console returns "Unable to get property 'parents' of undefined or null reference".
<div class="well">
<a href="javascript:void(0);" class="btn btn-primary act-button-expand-all ">+ Expand All</a>
<a href="javascript:void(0);" class="btn btn-primary act-button-collapse-all">- Collapse All</a>
</div>
I actually ran into this issue this morning. It looks like when e0c6e4dfbefef54e549f67a3138e0bd035e147e6 was pushed the signature of the _collaptable
was changed but not all references that invoke it.
Here was the fix I did, if the original author would like a PR, i can open one up: https://github.com/cemeyer2/aCollapTable
Note that now to support multiple tables on a given page, I passed in a table id on the expand all, such as:
<a href="javascript:void(0);" class="act-button-expand-all" data-table-id="foo_table_id">
...
The above did not work for me. The fix above no longer generated the error "Unable to get property 'parents' of undefined or null reference", and instead was just swapping the "+" and "-" and not collapsing or expanding the table. What i ended up doing is adding the'$table' as a parameter to the two calls to '_collaptable' from the collapse all expand all buttons for the click event, which is identical to what the '.act-button-expand' was doing. Previous: _collaptable($('.act-more', $(item))); New: _collaptable($table, $('.act-more', $(item)));
when i create collaptable through servlet using databse connection the data-parent should be "null" but in this tool the first data-parent is "". how it can be resolve. thank you.