Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

How can i delete the same object which are created in a different class?

$
0
0

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();
                }
            });
        });

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>