Hi, I have created 2 identical custom objects arrays having the classname called fullCourse and Receipt. They both contain the same data when i created them. however, i want to remove some of the input data, i only managed to remove one of the custom objects array and not both of them. Is there any way which i can remove the same object from both the arrays?
var Remove = Ti.UI.createButton({ title : 'Remove', textAlign : 'left', top : '10%', color : 'black', left : '90%' }); Remove.addEventListener('click', function(e) { Cloud.Objects.remove({ classname : 'fullCourse', id : maincourse.id }, function(o) { if (o.success) { var orderBtn = Titanium.UI.createWindow({ url : "/ui/tablet/OrderList.js", backgroundImage : '/images/imgSidedish/sidedishbg.png', modal : true, fullscreen : true, navBarHidden : true, orientationModes : [Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT] }); orderBtn.open(); self.close(); } }); Cloud.Objects.remove({ classname : 'Receipt', id : maincourse.id }, function(o) { if (o.success) { var orderBtn = Titanium.UI.createWindow({ url : "/ui/tablet/OrderList.js", backgroundImage : '/images/imgSidedish/sidedishbg.png', modal : true, fullscreen : true, navBarHidden : true, orientationModes : [Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT] }); orderBtn.open(); self.close(); } }); });