Open Monkeytactics opened 3 years ago
For clarity here - this method does return node data for me, as opposed to just id's with the 'includeNodeData' omitted - but it ignores any data content additions or edits and returns only data state at the point the orgchart was generated (including structure changes, if applicable).
For the benefit of others, I'm now using this to get node elements (that may have been edited) from the node tree:
var updates = $('div.node').map(function() { return { id: $(this).attr("id"), content: $(this).find('div.content').text(), note: $(this).find('div.note').text() }; }).get();
This gives me node content as it currently stands, you then just need to parse the getHierarchy(includeNodeData) result and update values with the result of above.
Hi Monkey. I am fashionably late to this party with developing something similar and have hit the same issue. Outputting to PNG and PDF works fine, but the hierarchy remains unchanged. Would be great if the changed content could be reflected automatically.
Been doing some digging and came across your issue. Just wondering how you implement the merging of the updates variable into the main hierarchy. Did you just identify the changed nodes or update the whole hierarchy?
I've implemented a 'b2t' version of this and it mostly works great. However, I added contentEditable =true to two node div's:
Unfortunately getHierarchy( includeNodeData ) only returns modified structure detail, this I am able to save just fine, but the modified node content is seemingly ignored by this method.
I can't find any reference to editing and saving content in addition to hierarchy, perhaps other users aren't doing this - perhaps I am missing something - is there a way to do this in the current codebase or do I need to add this functionality myself?