Would it be possible to create a listener or a custom hook, or a function that accesses the nestedRows plugin, and resized the rowHeaderWidth based on which rows are visible? My situation is that some of the parent rows have very short lengths, but the rowHeaderWidth is extra large to accommodate the children’s lengths. With this feature, the width could dynamically change based on which rows are showing.
NestedRows Resize
Hi @mariothomas
The nestedRows
does not have a dedicated hook yet.
Resizing rowHeaders
can be done by a call to the updateSettings()
and the alteration of the rowHeaderWidth()
. But as there is no callback that is returned when the user expands/collapses the parents you can try to get access via mouseup
event. Some time ago I did some tests and this approach https://jsfiddle.net/ucw1q702/ even if not recommended (as it is not using dedicated Handsontable API) works for collapse/expand detection.
Thanks! I think I can figure out an implementation for this.
Also is hot.getPlugin('nestedRows').collapsingUI.collapseChildren(i)
still a valid way to programmatically collapse a row (where hot
is the Handsontable Object and i
is the row index? Doesn’t seem to be working for me.
Yes, it is. Here is a demo http://jsfiddle.net/handsoncode/gceqrLd2/
Maybe the index 1
is not the parent element in your case.