I am looking to add an element to the drawnShapes array within the draw() function
and the getDrawnShapesCount() function should return the total number of shapes drawn
The drawnShapes variable represents an array of shapes
Ext.define('Shape', {
static: {
drawnShapes: ['Shape1'],
getDrawnShapesCount: function () {
console.log('the number of drawn shapes is :' +this.drawnShapes.length);
}
},
draw: function (newShape) {
debugger;
var newShape;
this.drawnShapes[this.drawnShapes.length -1 ]=[newShape];
// I try push too and it doesn't work
// this.drawnShapes.push(newShape);
console.log(newShape + 'is drawn....');
console.log('the number of drawnShapes is ' + this.drawnShapes.length)
},
});