fancytree folders never collapse -


fancytree folders never collapsed. children , parents displayed without correct nesting structure.

when copy exact same data works in text data source, instead web2py (python) controller folders not collapse display permanently expanded. no js console errors in browser.

original data works in text file

fancytree copies data python contoller this

json_list = [{   "alexlink": "http://example.com/",   "kind": "tasks#task",   "id": "mtywnzeznjc2oteymdi1mzcwnzm6oduwnjk4ntgzojexmtkyodk2mja",   "etag": "\"4qycalf1j510t_-i20nambuhf2k/ltezntgzmtmzodg\"",   "title": "task 01",   "updated": "2015-04-23t19:25:44.000z",   "selflink": "",   "position": "00000000002147483647",   "status": "needsaction" }] 

i convert json: json_list = json.dumps(json_list)

then use source:

// initialize fancytree $("#alextree").fancytree({     checkbox: true,     selectmode: 3,     source: {{=xml(json_list)}},     postprocess: function(event, data){         data.result = convertdata(data.response);     },     select: function(event, data) {         window.open(data.node.data.alexlink, "_blank"); 

data looks same in text file source. causing folders not contract children under them?

i can't see obvious reason, why sample not working (i assume persistence extension off?). except maybe {{=xml(json_list)}}, may unexpected. guess debuggable demo needed, find out.

anyway, sample this:

  1. generate tree data in native (none-fancytree) format
  2. generate html page embedded <script> tag in turn has data embedded string
  3. on page-load tree created native data , post processing done client-side

fancytree designed pattern in mind (among others):

  1. have static page empty <div id="tree"> element , include javascript
  2. on page-load initialize tree , pass ajax url source.
    display page users, while loading deferred (showing spinning icon)
  3. a data arrives, tree update.
    (you consider conversion server-side , send valid fancytree-compatible data.)

this deliver smoother user experience. allow refresh tree data without reloading page, calling tree.reload().


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -