Take a look at the link provided below.
Make sure to execute the sample code.
Grouping 1 rectangle - success.
- Click on 'Add Rect' twice to display two rectangles.
- Drag and select both objects.
- Press the group button.
- Objects successfully grouped.
Subclassing 2 objects - unsuccessful.
- Click on 'Add Labeled Rect' twice to show two subclassed objects (rectangles with text).
- Drag and select both objects.
- Attempt to group them.
- Error message appears in console.
Why can't subclassed objects be transformed into a group?
I have tried grouping rectangles and subclassed objects using version 1.4.4. While rectangles group perfectly, subclassed objects do not.
The error messages displayed are as follows:
Uncaught TypeError: undefined is not a function fabric-1.3.7.js:10702
fabric.Object.fabric.util.createClass.renderfabric-1.3.7.js:10702
fabric.Group.fabric.util.createClass._renderObjectfabric-1.3.7.js:15504
fabric.Group.fabric.util.createClass.renderfabric-1.3.7.js:15477
fabric.StaticCanvas.fabric.util.createClass._drawfabric-1.3.7.js:5751
fabric.StaticCanvas.fabric.util.createClass._renderObjectsfabric-1.3.7.js:5879
fabric.StaticCanvas.fabric.util.createClass.renderAllfabric-1.3.7.js:5850
fabric.Collection.addfabric-1.3.7.js:181
(anonymous function)GroupSubclassing.html:71
x.event.dispatchjquery-2.0.3.js:4676
y.handle