I have an object that I created using this snip-it that looks like this:
...
var steps = new Array();
this.createStep = function(){steps.push(new step()); return steps[steps.length-1];};
this.getSteps = function(){return steps;};
this.removeStep = function(pos){steps.splice(parseInt(pos), 1);};
this.insertStep = function(pos){steps.splice(parseInt(pos),0, new step());};
And it works great:
...
var newStep = wfObj.createStep();
newStep.setTitle('Step-'+i);
newStep.setStatus('New');
But it is not
var newStep = wfObj.createStep().setTitle('Step-'+i).setStatus('New');
Can someone please tell me how to fix this or even name when you link such methods?
source
share