With a lack of documents on Ext.draw I've had to draw an inference from the source on how to create simple sprites without going down the SVG path route.
Based on what I've done (and this is probably wrong) it throws an error when trying to add a sprite to a surface:
Below is some test code I wrote:
# Seems like this *should* be the way to create a sprite
sprite = @surface.createItem
# Seems redundant I need to pass the surface as a param
# Below also seems redundant
console.log 'sprite add called'
What appears to be happening is, when I log `sprite` I can see in Illumination that the returned object has a surface member - but when I try to add the sprite, this gets deleted (line 73 in Ext.draw.Sprite) and then firefox throws an error:
me.surface is undefined
Caused by line 100 in the setAttributes method
Also tried just the following, but nothing gets added to the SVG surface:
Basically I have a TreeStore for an organisation chart and want to draw that on the screen, with links - seems like a lot just to create a simple rectangle, especially when I want to hang event handlers off it as well for menus, and I want to be able to dynamically add new items to the surface as the organisation grows.
Surely there is a simple API for this? I mean the developer of Raphael works at Sencha on this, and this is the API they ended up going with rather than something simpler like Raphaels?