I'm using draw2d js library. I have the following code that creates a rectangle on the canvas.
var rect = new draw2d.shape.basic.Rectangle({x:20,y:30});
rect.on("click", function(){
//var that = this;
alert("test");
// I'm trying to access rect using this keyword but its not working
var c = new draw2d.Connection();
this.createPort('hybrid'); // adds a port on the rectangle
});
I'm trying to access rect using this keyword but its not working
Thanks!