admin管理员组文章数量:1410674
Since there's no jsPlumb forum anywhere I hope someone here can help me.
I want to generate this graph from some data I get from a JSON-API, what this API gives me are "devices" with a name and multiple sinks/sources, which I want to display as a list with the device-name in the first row.
So I thought I'd use some JQuery to generate these divs and add the jsPlumb-endpoints I need to the device. Unfortunately I can only get endpoints on existing divs to work but not on my dynamically generated ones. Firebug shows me the error "myOffset is null" in the addEndpoint function and I don't really see anything that's wrong.
I made a fiddle of it here: /
Since there's no jsPlumb forum anywhere I hope someone here can help me.
I want to generate this graph from some data I get from a JSON-API, what this API gives me are "devices" with a name and multiple sinks/sources, which I want to display as a list with the device-name in the first row.
So I thought I'd use some JQuery to generate these divs and add the jsPlumb-endpoints I need to the device. Unfortunately I can only get endpoints on existing divs to work but not on my dynamically generated ones. Firebug shows me the error "myOffset is null" in the addEndpoint function and I don't really see anything that's wrong.
I made a fiddle of it here: http://jsfiddle/2mcD2/4/
Share Improve this question asked Mar 12, 2012 at 21:00 ChrisChris 2172 silver badges9 bronze badges2 Answers
Reset to default 3Id of an element is invalid, :
is not allowed in ids.
jQuery("#source:foo") // will not work
jQuery("*[id='source:foo']") // will work, but you'll need to modify `jsPlumb` code in order to make it work this way
Solution: do not use :
in ids. _
and -
are ok.
there's a jsPlumb group here:
https://groups.google./forum/?fromgroups#!forum/jsplumb
本文标签: javascriptjsPlumb and dynamically added containersStack Overflow
版权声明:本文标题:javascript - jsPlumb and dynamically added containers - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744997194a2636749.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论