Question: Im building a small uml modeler with jointjs and raphael for a small project Im doing... I already draw classes by clicking on a button.

What I want to know specifically is how to get the onclick event working on jointjs classes diagrams, because when I click on the classes they do not work, also they move a little when I click on them, If I could get the onclick working I could probably get the objects clicked and draw the line on the background...

Any other ideas on how to draw the lines... maybe by dragging from one class to the other? 

Has anyone done this?

Thank you!

Answer: 
this is a sample code for jointjs 0.6, the trick is to use model-id attribute to select the object using jquery:

```
        var rect = new joint.shapes.basic.Rect({
        position: { x: 100, y: 30 },
        size: { width: 100, height: 30 },
        attrs: { rect: { fill: 'blue' }, text: { text: 'my box', fill: 'white' } }
    });

    graph.addCells([rect]);

    //here is the trick
    $("g[model-id='" +rect.id+ "']").click(function() {
        alert("x");
    });

```
jointjs provides the events call functionality. You can call events on your paper div.
Here is an example. May be this can help you out. For more, go for the link.
[List of triggered events on Paper](http://jointjs.com/api#joint.dia.Paper:events)
Code Example:

```
paper.on('cell:pointerdblclick',function(cellView, evt, x, y) {
     demo();
  });

function demo(){
 alert("1");
}

```

I hope this will give help to you.Thanks