javascript - Fancytree - Add new items into a tree node (date, notes, etc) -


fancytree has way add new items tree node?

in demos can see "title" displayed want add "date" , "notes".

i know can doit table extension , rendercolumns want sort info in different way , can't change linear structure of table css only.

i prefer use <div> or <span> elements instead of <table> sort , add css this.

i think html structure every <li> element in tree perfect:

<li>     <span class="fancytree-node fancytree-exp-n fancytree-ico-c">         <span class="fancytree-expander"></span>         <span class="fancytree-icon"></span>         <span class="fancytree-title">sub-item 4.1</span>         <span class="fancytree-date">21-5-2015</span>         <span class="fancytree-note">this note inside fancytree node</span>     </span> </li> 

here have jsfiddle json google tasks api structure populate fancytree.

http://jsfiddle.net/prncw2sl/11/

if go inside json link:

http://res.cloudinary.com/neuropro/raw/upload/v1431196887/jsongoogletasksaip_aevrz8.json

.. see in task id mtywnzeznjc2oteymdi1mzcwnzm6oduwnjk4ntgzojg4odk2mdi0mq has due date want add tree node.

also in same task see notes item. other content want add tree node.

some ideas?

thanks in advance.

you can pass html node.title, generate markup like

<span class="fancytree-node fancytree-exp-n fancytree-ico-c">     <span class="fancytree-expander"></span>     <span class="fancytree-icon"></span>     <span class="fancytree-title">         <span class="ft-header">sub-item 4.1</span>         <span class="ft-date">21-5-2015</span>         <span class="ft-note">this note inside fancytree node</span>     </span> </span> 

alternatively implement rendertitle or rendernode events , modify markup using jquery.

rendernode: function(event, data) {     // optionally tweak data.node.span     $(data.node.span).text(">>" + data.node.title); }, rendertitle: function(event, data) {     // when defined, must return html string node title     return "new title"; }, 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -