aCollapTable icon indicating copy to clipboard operation
aCollapTable copied to clipboard

Unable to get property 'parents' of undefined or null reference

Open KevinDuganJr opened this issue 9 years ago • 3 comments

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>

KevinDuganJr avatar Nov 24 '15 15:11 KevinDuganJr

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">
...

cemeyer2 avatar Mar 14 '17 16:03 cemeyer2

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)));

bt209 avatar Apr 17 '17 20:04 bt209

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.

rohitcsa avatar Jun 08 '17 12:06 rohitcsa