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 badges
Add a ment  | 

2 Answers 2

Reset to default 3

Id 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